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;
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) {
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);
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;
/* 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 */
/* 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;
}
if (*f != NULL) {
- retval = fclose (*f);
+ retval = fclose(*f);
*f = NULL;
}
* 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;
}
if (*f != NULL) {
- retval = fclose (*f);
+ retval = fclose(*f);
if (retval != 0) {
error_e("Error while fclosing %s", filedesc);
}
return retval;
}
-
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__ */
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) {