Changeset 18426 for trunk/Ohana/src/opihi/lib.shell/gprint.c
- Timestamp:
- Jul 6, 2008, 12:50:03 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/lib.shell/gprint.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/gprint.c
r17419 r18426 134 134 } 135 135 136 // check the special cases 136 // check the special cases (do not close old file in these cases) 137 137 if (stream[0].file == stdout) { 138 138 stream[0].file = file; … … 243 243 // we allow the user to set stdout to ERR and stderr to LOG if they want 244 244 if (!strcmp (stream[0].name, "stdout")) { 245 stream[0].file = stdout;245 gprintCloseFile (stream, stdout); 246 246 return; 247 247 } 248 248 if (!strcmp (stream[0].name, "stderr")) { 249 stream[0].file = stderr;249 gprintCloseFile (stream, stderr); 250 250 return; 251 251 } … … 254 254 file = fopen (stream[0].name, "a"); 255 255 if (file == NULL) { 256 // XXX this is a problem: we are leaving open the old file 256 257 fprintf (stderr, "cannot open file %s\n", stream[0].name); 257 258 free (stream[0].name); 258 stream[0].file = (dest == GP_LOG) ? stdout : stderr;259 file = (dest == GP_LOG) ? stdout : stderr; 259 260 stream[0].name = (dest == GP_LOG) ? strcreate ("stdout") : strcreate("stderr"); 261 gprintCloseFile (stream, file); 260 262 return; 261 263 }
Note:
See TracChangeset
for help on using the changeset viewer.
