Changeset 2655 for trunk


Ignore:
Timestamp:
Nov 3, 2011, 8:08:19 PM (13 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanoscale/server2.c

    r2449 r2655  
    2828#endif
    2929
    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__)
    3434
    3535static const char *syslogLevels[] = {
     
    6060static Tcl_HashTable serverTable;       /* Table of render servers
    6161                                         * representing services available to
    62                                          * clients.  A new instances is forked
     62                                         * clients.  A new instance is forked
    6363                                         * and executed each time a new
    6464                                         * request is accepted. */
     
    6666static pid_t serverPid;
    6767
    68 void
    69 LogMessage(int priority, const char *path, int lineNum, const char* fmt, ...)
     68static void
     69SysLog(int priority, const char *path, int lineNum, const char* fmt, ...)
    7070{
    7171#define MSG_LEN (2047)
     
    8383    }
    8484    length = snprintf(message, MSG_LEN, "nanoscale (%d %d) %s: %s:%d ",
    85                       serverPid, getpid(), syslogLevels[priority],  s, lineNum);
     85        serverPid, getpid(), syslogLevels[priority],  s, lineNum);
    8686    length += vsnprintf(message + length, MSG_LEN - length, fmt, lst);
    8787    message[MSG_LEN] = '\0';
     
    359359        fd_set readFds;
    360360
     361        /* Reset using the array of server file descriptors. */
    361362        memcpy(&readFds, &serverFds, sizeof(serverFds));
    362363        if (select(maxFd+1, &readFds, NULL, NULL, 0) <= 0) {
     
    450451                }
    451452                if (dup2(errFd, 2) < 0) { /* Stderr */
    452                     ERROR("%s: can't change to root directory for \"%s\": %s",
     453                    ERROR("%s: can't dup stderr for \"%s\": %s",
    453454                          serverPtr->name, strerror(errno));
    454455                    exit(1);
Note: See TracChangeset for help on using the changeset viewer.