Changeset 2655 for trunk/packages
- Timestamp:
- Nov 3, 2011, 8:08:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanoscale/server2.c
r2449 r2655 28 28 #endif 29 29 30 #define ERROR(...) LogMessage(LOG_ERR, __FILE__, __LINE__, __VA_ARGS__)31 #define TRACE(...) LogMessage(LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__)32 #define WARN(...) LogMessage(LOG_WARNING, __FILE__, __LINE__, __VA_ARGS__)33 #define INFO(...) LogMessage(LOG_INFO, __FILE__, __LINE__, __VA_ARGS__)30 #define ERROR(...) SysLog(LOG_ERR, __FILE__, __LINE__, __VA_ARGS__) 31 #define TRACE(...) SysLog(LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__) 32 #define WARN(...) SysLog(LOG_WARNING, __FILE__, __LINE__, __VA_ARGS__) 33 #define INFO(...) SysLog(LOG_INFO, __FILE__, __LINE__, __VA_ARGS__) 34 34 35 35 static const char *syslogLevels[] = { … … 60 60 static Tcl_HashTable serverTable; /* Table of render servers 61 61 * representing services available to 62 * clients. A new instance sis forked62 * clients. A new instance is forked 63 63 * and executed each time a new 64 64 * request is accepted. */ … … 66 66 static pid_t serverPid; 67 67 68 void69 LogMessage(int priority, const char *path, int lineNum, const char* fmt, ...)68 static void 69 SysLog(int priority, const char *path, int lineNum, const char* fmt, ...) 70 70 { 71 71 #define MSG_LEN (2047) … … 83 83 } 84 84 length = snprintf(message, MSG_LEN, "nanoscale (%d %d) %s: %s:%d ", 85 85 serverPid, getpid(), syslogLevels[priority], s, lineNum); 86 86 length += vsnprintf(message + length, MSG_LEN - length, fmt, lst); 87 87 message[MSG_LEN] = '\0'; … … 359 359 fd_set readFds; 360 360 361 /* Reset using the array of server file descriptors. */ 361 362 memcpy(&readFds, &serverFds, sizeof(serverFds)); 362 363 if (select(maxFd+1, &readFds, NULL, NULL, 0) <= 0) { … … 450 451 } 451 452 if (dup2(errFd, 2) < 0) { /* Stderr */ 452 ERROR("%s: can't change to root directoryfor \"%s\": %s",453 ERROR("%s: can't dup stderr for \"%s\": %s", 453 454 serverPtr->name, strerror(errno)); 454 455 exit(1);
Note: See TracChangeset
for help on using the changeset viewer.