aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/crond.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 24aa3dcc3..c7d1a6c50 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -114,14 +114,14 @@ static void crondlog(const char *ctl, ...)
114 if (LogFile == 0) { 114 if (LogFile == 0) {
115 vsyslog(type, fmt, va); 115 vsyslog(type, fmt, va);
116 } else { 116 } else {
117#if !ENABLE_DEBUG_CROND_OPTION
117 int logfd = open(LogFile, O_WRONLY | O_CREAT | O_APPEND, 0600); 118 int logfd = open(LogFile, O_WRONLY | O_CREAT | O_APPEND, 0600);
119#else
120 int logfd = open3_or_warn(LogFile, O_WRONLY | O_CREAT | O_APPEND, 0600);
121#endif
118 if (logfd >= 0) { 122 if (logfd >= 0) {
119 vdprintf(logfd, fmt, va); 123 vdprintf(logfd, fmt, va);
120 close(logfd); 124 close(logfd);
121#if ENABLE_DEBUG_CROND_OPTION
122 } else {
123 bb_perror_msg("can't open log file");
124#endif
125 } 125 }
126 } 126 }
127 } 127 }
@@ -281,10 +281,9 @@ static void startlogger(void)
281 else { /* test logfile */ 281 else { /* test logfile */
282 int logfd; 282 int logfd;
283 283
284 if ((logfd = open(LogFile, O_WRONLY | O_CREAT | O_APPEND, 0600)) >= 0) { 284 logfd = open3_or_warn(LogFile, O_WRONLY | O_CREAT | O_APPEND, 0600);
285 if (logfd >= 0) {
285 close(logfd); 286 close(logfd);
286 } else {
287 bb_perror_msg("failed to open log file '%s': ", LogFile);
288 } 287 }
289 } 288 }
290#endif 289#endif