scron

simple cron daemon
git clone git://git.2f30.org/scron
Log | Files | Refs | README | LICENSE

commit a4cd2a540f2d4ef73d571ca5d42d127f7a542232
parent 032a95c1ef5a100a107066773667c1b17f5b4b91
Author: sin <sin@2f30.org>
Date:   Thu,  3 Jul 2014 13:39:55 +0100

Style fix

Diffstat:
Mcrond.c | 27++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/crond.c b/crond.c @@ -99,11 +99,14 @@ runjob(char *cmd) pid = fork(); if (pid < 0) { - logerr("error: failed to fork job: %s at %s", cmd, ctime(&t)); + logerr("error: failed to fork job: %s at %s", + cmd, ctime(&t)); } else if (pid == 0) { - loginfo("run: %s pid: %d at %s", cmd, getpid, ctime(&t)); + loginfo("run: %s pid: %d at %s", + cmd, getpid, ctime(&t)); execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL); - logerr("error: failed to execute job: %s at %s", cmd, ctime(&t)); + logerr("error: failed to execute job: %s at %s", + cmd, ctime(&t)); _exit(EXIT_FAILURE); } } @@ -232,7 +235,8 @@ loadentries(void) col = strsep(&p, "\t"); if (!col || parsefield(col, 0, 59, &cte->min) < 0) { - logerr("error: failed to parse `min' field on line %d\n", y + 1); + logerr("error: failed to parse `min' field on line %d\n", + y + 1); free(cte); r = -1; break; @@ -240,7 +244,8 @@ loadentries(void) col = strsep(&p, "\t"); if (!col || parsefield(col, 0, 23, &cte->hour) < 0) { - logerr("error: failed to parse `hour' field on line %d\n", y + 1); + logerr("error: failed to parse `hour' field on line %d\n", + y + 1); free(cte); r = -1; break; @@ -248,7 +253,8 @@ loadentries(void) col = strsep(&p, "\t"); if (!col || parsefield(col, 1, 31, &cte->mday) < 0) { - logerr("error: failed to parse `mday' field on line %d\n", y + 1); + logerr("error: failed to parse `mday' field on line %d\n", + y + 1); free(cte); r = -1; break; @@ -256,7 +262,8 @@ loadentries(void) col = strsep(&p, "\t"); if (!col || parsefield(col, 1, 12, &cte->mon) < 0) { - logerr("error: failed to parse `mon' field on line %d\n", y + 1); + logerr("error: failed to parse `mon' field on line %d\n", + y + 1); free(cte); r = -1; break; @@ -264,7 +271,8 @@ loadentries(void) col = strsep(&p, "\t"); if (!col || parsefield(col, 0, 6, &cte->wday) < 0) { - logerr("error: failed to parse `wday' field on line %d\n", y + 1); + logerr("error: failed to parse `wday' field on line %d\n", + y + 1); free(cte); r = -1; break; @@ -272,7 +280,8 @@ loadentries(void) col = strsep(&p, "\n"); if (!col) { - logerr("error: missing `cmd' field on line %d\n", y + 1); + logerr("error: missing `cmd' field on line %d\n", + y + 1); free(cte); r = -1; break;