IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38573


Ignore:
Timestamp:
Jul 6, 2015, 8:10:33 PM (11 years ago)
Author:
eugene
Message:

handle file open failure for stdout,stderr redirect more cleanly

Location:
branches/eam_branches/ipp-20150625/Ohana/src/opihi/pantasks
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150625/Ohana/src/opihi/pantasks/CheckJobs.c

    r27614 r38573  
    11# include "pantasks.h"
     2static int Ncheck = 0;
    23
    34float CheckJobs () {
     
    1213  float time_running, next_timeout;
    1314
    14   // int Ncheck;
    15   // Ncheck = 0;
     15  Ncheck ++;
    1616
    1717  // actual maximum delay is controlled in job_threads.c
     
    2121  /** test all jobs: ready to test?  finished? **/
    2222  while ((job = NextJob ()) != NULL) {
    23     // Ncheck ++;
    2423
    2524    task = job[0].task;
     
    220219    SetTaskTimer (&job[0].last);
    221220  }
    222   // fprintf (stderr, "check %d jobs\n", Ncheck);
     221
    223222  JobTaskUnlock();
    224223  return (next_timeout);
  • branches/eam_branches/ipp-20150625/Ohana/src/opihi/pantasks/CheckTasks.c

    r31666 r38573  
    11# include "pantasks.h"
     2static int Ncheck = 0;
    23
    34float CheckTasks () {
     
    78  int status;
    89  float time_running, next_timeout, fuzz;
     10
     11  Ncheck ++;
    912
    1013  // actual maximum delay is controlled in job_threads.c
  • branches/eam_branches/ipp-20150625/Ohana/src/opihi/pantasks/JobOps.c

    r36623 r38573  
    207207  }
    208208
     209  Task *task = job->task;
    209210  FreeJob (jobs[Nm]);
    210211  for (i = Nm; i < Njobs - 1; i++) {
     
    218219  }
    219220
    220   job[0].task[0].Npending --;
     221  task->Npending --;
    221222  return (TRUE);
    222223}
  • branches/eam_branches/ipp-20150625/Ohana/src/opihi/pantasks/pantasks_server.c.in

    r32632 r38573  
    1919 
    2020  char hostname[256], portinfo[256];
    21   char log_stdout[1024], log_stderr[1024];
     21  char log_stdout[1024], log_stderr[1024], tmpname[1024];
    2222  pthread_t JobsAndTasksThread;
    2323  pthread_t clientsThread;
     
    3434  stdin = freopen ("/dev/zero", "r", stdin);
    3535
    36   // this block redirects the actual stderr, stdout steams to the output files
    37   if (VarConfig ("PANTASKS_SERVER_STDOUT", "%s", log_stdout) != NULL) {
     36  // this block redirects the actual stderr, stdout streams to the output files
     37  if (VarConfig ("PANTASKS_SERVER_STDOUT", "%s", tmpname) != NULL) {
     38    strcpy (log_stdout, tmpname);
    3839    if (strcmp (log_stdout, "stdout")) {
    3940      stdout = freopen (log_stdout, "a", stdout);
     
    4445    }
    4546  }
    46   if (VarConfig ("PANTASKS_SERVER_STDERR", "%s", log_stderr) != NULL) {
     47  if (VarConfig ("PANTASKS_SERVER_STDERR", "%s", tmpname) != NULL) {
     48    strcpy (log_stderr, tmpname);
    4749    if (strcmp (log_stderr, "stderr")) {
    4850      stderr = freopen (log_stderr, "a", stderr);
  • branches/eam_branches/ipp-20150625/Ohana/src/opihi/pantasks/test/local.sh

    r10647 r38573  
    11
    22## a basic test of memory allocation
     3if (not($?VERBOSE)) set VERBOSE = 0
    34
    45exec rm -f tmp.txt
     
    3839 $startmem = $word:1
    3940end
     41
    4042macro memcheck
    4143 list word -x "ps -p $PID -o rss"
Note: See TracChangeset for help on using the changeset viewer.