IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 18, 2006, 6:58:54 AM (20 years ago)
Author:
eugene
Message:

updates to fix comm problems with buffers (motivated by opihi gprint)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/gprint.c

    r7917 r7929  
    7777    return (&streams[i]);
    7878  }
    79   fprintf (STDERR, "programming error: gprintInit not called for thread\n");
     79  fprintf (stderr, "programming error: gprintInit not called for thread\n");
    8080  abort ();
    8181}
     
    9090  if (stream[0].file != NULL) {
    9191    fflush (stream[0].file);
    92     if (stream[0].file != stdout) fclose (stream[0].file);
     92    if (stream[0].file == stdout) goto skip_close;
     93    if (stream[0].file == stderr) goto skip_close;
     94    fclose (stream[0].file);
     95
     96  skip_close:
    9397    stream[0].file = NULL;
    9498  }
     
    146150  stream[0].file = fopen (filename, "a");
    147151  if (stream[0].file == NULL) {
    148     fprintf (STDERR, "cannot open file %s\n", filename);
     152    fprintf (stderr, "cannot open file %s\n", filename);
    149153    stream[0].file = (dest == GP_LOG) ? stdout : stderr;
    150154  }
Note: See TracChangeset for help on using the changeset viewer.