commit f8fddb39a9c2f0df3eb6087e22af43e414f1f406
parent 371b321ad7a0f9fcc4f9eff2d57a744052bf1647
Author: sin <sin@2f30.org>
Date: Wed, 2 Jul 2014 14:06:36 +0100
pid_t is guaranteed to fit in an int by POSIX
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/crond.c b/crond.c
@@ -114,7 +114,7 @@ runjob(char *cmd)
printf("run: %s pid: %d time: %s", cmd, getpid(), ctime(&t));
fflush(stdout);
syslog(LOG_INFO, "run: %s pid: %d", cmd, getpid());
- execl("/bin/sh", "/bin/sh", "-c", cmd, (char *) NULL);
+ execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL);
fprintf(stderr, "error: job failed: %s time: %s\n", cmd, ctime(&t));
syslog(LOG_WARNING, "error: job failed: %s", cmd);
_exit(EXIT_FAILURE);
@@ -131,9 +131,9 @@ waitjob(void)
t = time(NULL);
while ((pid = waitpid(-1, &status, WNOHANG | WUNTRACED)) > 0) {
- printf("complete: pid %d, return: %d time: %s", (int) pid, status, ctime(&t));
+ printf("complete: pid %d, return: %d time: %s", pid, status, ctime(&t));
fflush(stdout);
- syslog(LOG_INFO, "complete: pid: %d return: %d", (int) pid, status);
+ syslog(LOG_INFO, "complete: pid: %d return: %d", pid, status);
}
}