diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/omfile.c | 6 | ||||
-rw-r--r-- | tools/syslogd.c | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/tools/omfile.c b/tools/omfile.c index c7283e4d..3e845a73 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -132,7 +132,7 @@ ENDisCompatibleWithFeature BEGINdbgPrintInstInfo CODESTARTdbgPrintInstInfo if(pData->bDynamicName) { - printf("[dynamic]\n\ttemplate='%s'" + dbgprintf("[dynamic]\n\ttemplate='%s'" "\tfile cache size=%d\n" "\tcreate directories: %s\n" "\tfile owner %d, group %d\n" @@ -146,9 +146,9 @@ CODESTARTdbgPrintInstInfo pData->bFailOnChown ? "yes" : "no" ); } else { /* regular file */ - printf("%s", pData->f_fname); + dbgprintf("%s", pData->f_fname); if (pData->fd == -1) - printf(" (unused)"); + dbgprintf(" (unused)"); } ENDdbgPrintInstInfo diff --git a/tools/syslogd.c b/tools/syslogd.c index 2f06d273..f686a769 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -946,7 +946,7 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags) MsgSetRcvFrom(pMsg, glbl.GetLocalHostName()); MsgSetRcvFromIP(pMsg, UCHAR_CONSTANT("127.0.0.1")); /* check if we have an error code associated and, if so, - * adjust the tag. -- r5gerhards, 2008-06-27 + * adjust the tag. -- rgerhards, 2008-06-27 */ if(iErr == NO_ERRCODE) { MsgSetTAG(pMsg, "rsyslogd:"); @@ -969,7 +969,8 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags) * supressor statement. */ if(((Debug || NoFork) && bErrMsgToStderr) || iConfigVerify) { - fprintf(stderr, "rsyslogd: %s\n", msg); + if(LOG_PRI(pri) == LOG_ERR) + fprintf(stderr, "rsyslogd: %s\n", msg); } if(bHaveMainQueue == 0) { /* not yet in queued mode */ @@ -2752,7 +2753,7 @@ init(void) */ snprintf(bufStartUpMsg, sizeof(bufStartUpMsg)/sizeof(char), " [origin software=\"rsyslogd\" " "swVersion=\"" VERSION \ - "\" x-pid=\"%d\" x-info=\"http://www.rsyslog.com\"] restart", + "\" x-pid=\"%d\" x-info=\"http://www.rsyslog.com\"] (re)start", (int) myPid); logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar*)bufStartUpMsg, 0); @@ -3473,7 +3474,9 @@ doGlblProcessInit(void) exit(1); /* "good" exit - after forking, not diasabling anything */ } num_fds = getdtablesize(); - for (i= 0; i < num_fds; i++) + close(0); + /* we keep stdout and stderr open in case we have to emit something */ + for (i = 3; i < num_fds; i++) (void) close(i); untty(); } |