From cae3de70d27f73921bde00359a9c7af7ee1b0fd7 Mon Sep 17 00:00:00 2001 From: Thibault Godouet Date: Mon, 4 Feb 2013 19:37:42 +0000 Subject: [PATCH] Applied indentation with 'make indent' --- fcron.c | 2 +- fcrondyn.c | 4 ++-- fcrontab.c | 2 +- fileconf.c | 4 ++-- filesubs.c | 9 ++++----- filesubs.h | 4 ++-- job.c | 31 +++++++++++++++---------------- 7 files changed, 27 insertions(+), 29 deletions(-) diff --git a/fcron.c b/fcron.c index ca913b8..4db9087 100644 --- a/fcron.c +++ b/fcron.c @@ -289,7 +289,7 @@ is_system_startup(void) if ((reboot = creat(REBOOT_LOCK, S_IRUSR & S_IWUSR)) < 0) error_e("Can't create lock for reboot jobs."); else - xclose_check(&reboot, REBOOT_LOCK); + xclose_check(&reboot, REBOOT_LOCK); /* run @reboot jobs */ return 1; diff --git a/fcrondyn.c b/fcrondyn.c index 1897045..9356c60 100644 --- a/fcrondyn.c +++ b/fcrondyn.c @@ -692,7 +692,7 @@ interactive_mode(int fd) if (line_read && *line_read) { add_history(line_read); } -#endif /* HAVE_READLINE_HISTORY */ +#endif /* HAVE_READLINE_HISTORY */ free(line_read); if (return_code == QUIT_CMD || return_code == ERR) { @@ -779,7 +779,7 @@ int main(int argc, char **argv) { int return_code = 0; - int fd = (-1); /* fd == -1 means connection to fcron is not currently open */ + int fd = (-1); /* fd == -1 means connection to fcron is not currently open */ struct passwd *pass = NULL; rootuid = get_user_uid_safe(ROOTNAME); diff --git a/fcrontab.c b/fcrontab.c index 3f6767e..41931fc 100644 --- a/fcrontab.c +++ b/fcrontab.c @@ -432,7 +432,7 @@ edit_file(const char *fcron_orig) cureditor = editor; /* temp_file() dies on error, so tmp_str is always set */ - file = temp_file(&tmp_str); + file = temp_file(&tmp_str); if ((fi = fdopen(file, "w")) == NULL) { error_e("could not fdopen"); goto exiterr; diff --git a/fileconf.c b/fileconf.c index b1fbead..e059035 100644 --- a/fileconf.c +++ b/fileconf.c @@ -1346,14 +1346,14 @@ read_shortcut(char *ptr, cf_t * cf) /* The next char must be a space (no other option allowed when using * a shortcut: if the user wants to use options, they should use the * native fcron lines */ - if ( ! isspace((int) *ptr) ) { + if (!isspace((int)*ptr)) { fprintf(stderr, "%s:%d: No space after shortcut: skipping line.\n", file_name, line); goto exiterr; } /* skip spaces before the username / shell command */ - while (isspace((int) *ptr)) + while (isspace((int)*ptr)) ptr++; /* check for inline runas */ diff --git a/filesubs.c b/filesubs.c index 036c227..66b66c2 100644 --- a/filesubs.c +++ b/filesubs.c @@ -62,7 +62,7 @@ xclose_check(int *fd, const char *filedesc) /* fclose() a file, and set the FILE* to NULL. * Returns fclose()'s return value and leaves errno as is. */ int -xfclose(FILE **f) +xfclose(FILE ** f) { int retval = EOF; @@ -71,7 +71,7 @@ xfclose(FILE **f) } if (*f != NULL) { - retval = fclose (*f); + retval = fclose(*f); *f = NULL; } @@ -82,7 +82,7 @@ xfclose(FILE **f) * Returns fclose()'s return value. * WARNING: do NOT call from log.c to avoid potential infinite loops! */ int -xfclose_check(FILE **f, const char *filedesc) +xfclose_check(FILE ** f, const char *filedesc) { int retval = EOF; @@ -91,7 +91,7 @@ xfclose_check(FILE **f, const char *filedesc) } if (*f != NULL) { - retval = fclose (*f); + retval = fclose(*f); if (retval != 0) { error_e("Error while fclosing %s", filedesc); } @@ -100,4 +100,3 @@ xfclose_check(FILE **f, const char *filedesc) return retval; } - diff --git a/filesubs.h b/filesubs.h index 43e5615..8472399 100644 --- a/filesubs.h +++ b/filesubs.h @@ -33,7 +33,7 @@ int xclose(int *fd); int xclose_check(int *fd, const char *filedesc); -int xfclose(FILE **f); -int xfclose_check(FILE **f, const char *filedesc); +int xfclose(FILE ** f); +int xfclose_check(FILE ** f, const char *filedesc); #endif /* __FILESUBS_H__ */ diff --git a/job.c b/job.c index 998da12..0243d03 100644 --- a/job.c +++ b/job.c @@ -772,27 +772,26 @@ end_job(cl_t * line, int status, FILE * mailf, short mailpos, char *m = NULL; #ifdef USE_SENDMAIL - if (mailf != NULL - && (is_mailzerolength(line->cl_option) - || (is_mail(line->cl_option) - && ( - /* job wrote some output and we wan't it in any case: */ - ((fseek(mailf, 0, SEEK_END) == 0 - && ftell(mailf) > mailpos) - && !is_erroronlymail(line->cl_option)) - || - /* or we want an email only if the job returned an error: */ - !(WIFEXITED(status) - && WEXITSTATUS(status) == 0) - ) - ) - ) + if (mailf != NULL && (is_mailzerolength(line->cl_option) + || (is_mail(line->cl_option) + && ( + /* job wrote some output and we wan't it in any case: */ + ((fseek(mailf, 0, SEEK_END) == 0 + && ftell(mailf) > mailpos) + && !is_erroronlymail(line->cl_option)) + || + /* or we want an email only if the job returned an error: */ + !(WIFEXITED(status) + && WEXITSTATUS(status) == 0) + ) + ) + ) ) { /* an output exit : we will mail it */ mail_output = 1; } /* or else there is no output to email -- mail_output is already set to 0 */ -#endif /* USE_SENDMAIL */ +#endif /* USE_SENDMAIL */ m = (mail_output == 1) ? " (mailing output)" : ""; if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { -- 2.47.3