ps: conditionally enable -T on non-DESKTOP build too
[oweals/busybox.git] / miscutils / crond.c
index b2fedb152c66fff597e8f83744b62b18b0b5ea25..f0b64fe3aaeb9a298c987c6d7385730443626e79 100644 (file)
@@ -55,7 +55,7 @@ typedef struct CronLine {
 #if ENABLE_FEATURE_CROND_CALL_SENDMAIL
        int cl_MailPos;         /* 'empty file' size                    */
        smallint cl_MailFlag;   /* running pid is for mail              */
-       char *cl_MailTo;        /* whom to mail results                 */
+       char *cl_MailTo;        /* whom to mail results                 */
 #endif
        /* ordered by size, not in natural order. makes code smaller: */
        char cl_Dow[7];         /* 0-6, beginning sunday                */
@@ -142,7 +142,7 @@ static void crondlog(const char *ctl, ...)
                /* Syslog mode: all to syslog (logmode = LOGMODE_SYSLOG), */
                if (!DebugOpt && LogFile) {
                        /* Otherwise (log to file): we reopen log file at every write: */
-                       int logfd = open3_or_warn(LogFile, O_WRONLY | O_CREAT | O_APPEND, 0600);
+                       int logfd = open3_or_warn(LogFile, O_WRONLY | O_CREAT | O_APPEND, 0666);
                        if (logfd >= 0)
                                xmove_fd(logfd, STDERR_FILENO);
                }
@@ -162,11 +162,11 @@ int crond_main(int argc UNUSED_PARAM, char **argv)
        INIT_G();
 
        /* "-b after -f is ignored", and so on for every pair a-b */
-       opt_complementary = "f-b:b-f:S-L:L-S" USE_FEATURE_CROND_D(":d-l")
+       opt_complementary = "f-b:b-f:S-L:L-S" IF_FEATURE_CROND_D(":d-l")
                        ":l+:d+"; /* -l and -d have numeric param */
-       opt = getopt32(argv, "l:L:fbSc:" USE_FEATURE_CROND_D("d:"),
+       opt = getopt32(argv, "l:L:fbSc:" IF_FEATURE_CROND_D("d:"),
                        &LogLevel, &LogFile, &CDir
-                       USE_FEATURE_CROND_D(,&LogLevel));
+                       IF_FEATURE_CROND_D(,&LogLevel));
        /* both -d N and -l N set the same variable: LogLevel */
 
        if (!(opt & OPT_f)) {
@@ -775,7 +775,7 @@ ForkJob(const char *user, CronLine *line, int mailFd,
                }
                /* crond 3.0pl1-100 puts tasks in separate process groups */
                bb_setpgrp();
-               execlp(prog, prog, cmd, arg, NULL);
+               execlp(prog, prog, cmd, arg, (char *) NULL);
                crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, prog, cmd, arg);
                if (mail_filename) {
                        fdprintf(1, "Exec failed: %s -c %s\n", prog, arg);
@@ -912,7 +912,7 @@ static void RunJob(const char *user, CronLine *line)
                }
                /* crond 3.0pl1-100 puts tasks in separate process groups */
                bb_setpgrp();
-               execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL);
+               execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, (char *) NULL);
                crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user,
                                 DEFAULT_SHELL, "-c", line->cl_Shell);
                _exit(EXIT_SUCCESS);