IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 81


Ignore:
Timestamp:
May 21, 2003, 10:39:30 AM (23 years ago)
Author:
eugene
Message:

freopen - fixed usage, no reassign of stderr = f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/imregister/src/imstatreg.c

    r75 r81  
    11# include "imregister.h"
    22# include "imreg.h"
    3 static char *version = "imstatreg $Revision: 3.3 $";
     3static char *version = "imstatreg $Revision: 3.4 $";
    44
    55int main (int argc, char **argv) {
     
    3737
    3838  /* redirect stderr, stdout to logfile */
    39   f = freopen (LogFile, "w", stderr);
    40   if (f == (FILE *) NULL)
     39  f = freopen (LogFile, "a", stdout);
     40  if (f == (FILE *) NULL) {
    4141    fprintf (stderr, "can't open log file %s, writing to stderr\n", LogFile);
    42   else
    43     stderr = f;
    44   f = freopen (LogFile, "w", stdout);
    45   if (f == (FILE *) NULL)
    46     fprintf (stderr, "can't open log file %s, writing to stderr\n", LogFile);
    47   else
    48     stdout = f;
     42  }
     43  f = freopen (LogFile, "a", stderr);
     44  /* an error here will be missed, but is unlikely since we have access in the above test */
    4945
    5046  /* start loop */
Note: See TracChangeset for help on using the changeset viewer.