aboutsummaryrefslogtreecommitdiff
path: root/miscutils/crond.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-10-22 10:56:47 +0000
committerEric Andersen <andersen@codepoet.org>2003-10-22 10:56:47 +0000
commita48b0a3af71958c1cea6389893371664a47b1a39 (patch)
tree59ed865eb6eb4b619257fc51fb19091ec5844d79 /miscutils/crond.c
parent514633bf3f4f941d3ba1bb47cc46c31734574cf6 (diff)
downloadbusybox-w32-a48b0a3af71958c1cea6389893371664a47b1a39.tar.gz
busybox-w32-a48b0a3af71958c1cea6389893371664a47b1a39.tar.bz2
busybox-w32-a48b0a3af71958c1cea6389893371664a47b1a39.zip
last_patch116 from vodz:
Stephane, >Using busybox+uclibc, crond syslog messages look like: > >Oct 9 09:04:46 soekris cron.notice crond[347]: ^Icrond 2.3.2 dillon, >started, log level 8 Thanks for testing. >The attached patch corrects the problem. Your patch is not correct. Correct patch attached. Also. Last patch have - add "Broken pipe" message to ash.c - busybox ash synced with dash_0.4.18 --w vodz
Diffstat (limited to 'miscutils/crond.c')
-rw-r--r--miscutils/crond.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 7915b860a..6de00dfde 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -114,24 +114,26 @@ static void
114crondlog(const char *ctl, ...) 114crondlog(const char *ctl, ...)
115{ 115{
116 va_list va; 116 va_list va;
117 const char *fmt;
117 int level = (int)(ctl[0] & 0xf); 118 int level = (int)(ctl[0] & 0xf);
118 int type = level == 20 ? 119 int type = level == 20 ?
119 LOG_ERR : ((ctl[0] & 0100) ? LOG_WARNING : LOG_NOTICE); 120 LOG_ERR : ((ctl[0] & 0100) ? LOG_WARNING : LOG_NOTICE);
120 121
121 122
122 va_start(va, ctl); 123 va_start(va, ctl);
124 fmt = ctl+1;
123 if (level >= LogLevel) { 125 if (level >= LogLevel) {
124 126
125#ifdef FEATURE_DEBUG_OPT 127#ifdef FEATURE_DEBUG_OPT
126 if (DebugOpt) vfprintf(stderr, ctl, va); 128 if (DebugOpt) vfprintf(stderr, fmt, va);
127 else 129 else
128#endif 130#endif
129 if (LogFile == 0) vsyslog(type, ctl, va); 131 if (LogFile == 0) vsyslog(type, fmt, va);
130 else { 132 else {
131 int logfd; 133 int logfd;
132 134
133 if ((logfd = open(LogFile, O_WRONLY|O_CREAT|O_APPEND, 600)) >= 0) { 135 if ((logfd = open(LogFile, O_WRONLY|O_CREAT|O_APPEND, 600)) >= 0) {
134 vdprintf(logfd, ctl, va); 136 vdprintf(logfd, fmt, va);
135 close(logfd); 137 close(logfd);
136#ifdef FEATURE_DEBUG_OPT 138#ifdef FEATURE_DEBUG_OPT
137 } else { 139 } else {