Changeset 7569
- Timestamp:
- Jun 14, 2006, 2:17:32 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psLogMsg.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psLogMsg.c
r7568 r7569 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.5 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-06-15 00:1 4:49$13 * @version $Revision: 1.55 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-06-15 00:17:32 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 42 42 #define MAX_LOG_LINE_LENGTH 256 43 43 44 static int logFD = 2;// Log file descriptor44 static int logFD = STDERR_FILENO; // Log file descriptor 45 45 static psS32 globalLogLevel = PS_LOG_INFO; // log all messages at this or above 46 46 static psBool logTime = true; // Flag to include time info … … 87 87 bool psLogSetDestination(int fd) 88 88 { 89 if (fd < = -1) {89 if (fd < 0) { 90 90 return false; 91 91 } 92 92 93 93 // Close the current FD if it's not stdout, stderr. 94 if (logFD > 2) {94 if (logFD > STDERR_FILENO) { 95 95 close(logFD); 96 96 } … … 186 186 // Special destinations: stdout, stderr 187 187 if (strcmp(dest, "stdout") == 0) { 188 return 1;188 return STDOUT_FILENO; 189 189 } 190 190 if (strcmp(dest, "stderr") == 0) { 191 return 2;191 return STDERR_FILENO; 192 192 } 193 193 … … 250 250 // If it's an abort, we always want to see the message 251 251 if (logFD == 0 && level == PS_LOG_ABORT) { 252 logFD = 2;252 logFD = STDERR_FILENO; 253 253 } 254 254 // If logging is off, or if the level is too high, return immediately. … … 352 352 if (level == PS_LOG_ABORT) { 353 353 switch (logFD) { 354 case 1:354 case STDOUT_FILENO: 355 355 fflush(stdout); 356 356 break; 357 case 2:357 case STDERR_FILENO: 358 358 fflush(stderr); 359 359 break;
Note:
See TracChangeset
for help on using the changeset viewer.
