]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
Applied indentation with 'make indent'.
authorThibault Godouet <yo8192@users.noreply.github.com>
Wed, 1 Jan 2025 11:12:58 +0000 (11:12 +0000)
committerThibault Godouet <yo8192@users.noreply.github.com>
Wed, 1 Jan 2025 11:20:39 +0000 (11:20 +0000)
26 files changed:
cl.c
conf.c
convert-fcrontab.c
database.c
env_list.c
exe_list.c
exe_list_test.c
fcron.c
fcrondyn.c
fcrondyn_svr.c
fcronsighup.c
fcrontab.c
fifo_list.c
fileconf.c
filesubs.c
job.c
job.h
lavg_list.c
log.c
mail.c
mail.h
save.c
select.c
subs.c
suspend.c
u_list.c

diff --git a/cl.c b/cl.c
index 1b6178c8d42b88ed1374a0208661974799bc86fc..148038215f44d8a92cf14d4e62b0ebfad6302b39 100644 (file)
--- a/cl.c
+++ b/cl.c
@@ -26,7 +26,7 @@
 #include "mem.h"
 
 cl_t *
-dups_cl(cl_t * orig)
+dups_cl(cl_t *orig)
     /* Duplicate a line, including the strings it points to. */
 {
     cl_t *cl = NULL;
@@ -63,7 +63,7 @@ dups_cl(cl_t * orig)
 }
 
 void
-free_line(cl_t * cl)
+free_line(cl_t *cl)
     /* free a line, including its fields */
 {
     if (cl != NULL) {
diff --git a/conf.c b/conf.c
index 18f9569ebad88a56dd988f9f37633fa4dc8841b7..87c00be0b81acf3ad074b279c5936d8c5e74c92e 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -436,7 +436,7 @@ read_type(int fd, short int *type, short int *size)
         }
 
 int
-read_file(const char *file_name, cf_t * cf, int is_system_startup)
+read_file(const char *file_name, cf_t *cf, int is_system_startup)
     /* read a formated fcrontab.
      * return ERR on error, OK otherwise */
 {
@@ -559,7 +559,7 @@ read_file(const char *file_name, cf_t * cf, int is_system_startup)
 
         /* if we get here, sec_class and access_vec are both defined */
         retval = security_compute_av(cf->cf_user_context, cf->cf_file_context,
-                                sec_class, access_vec, &avd);
+                                     sec_class, access_vec, &avd);
 
         if (retval || ((access_vec & avd.allowed) != access_vec)) {
             syslog(LOG_ERR, "ENTRYPOINT FAILED for Linux user '%s' "
@@ -827,7 +827,7 @@ read_file(const char *file_name, cf_t * cf, int is_system_startup)
 
 
 int
-add_line_to_file(cl_t * cl, cf_t * cf, uid_t runas, char *runas_str,
+add_line_to_file(cl_t *cl, cf_t *cf, uid_t runas, char *runas_str,
                  time_t t_save, int is_system_startup)
     /* check if the line is valid, and if yes, add it to the file cf */
 {
@@ -1010,7 +1010,7 @@ delete_file(const char *user_name)
 
 
 void
-save_file(cf_t * arg_file)
+save_file(cf_t *arg_file)
 /* Store the informations relatives to the executions
  * of tasks at a defined frequency of system's running time */
 {
index 6b799f7829ed9dab237a1d0c8d316b7fbc493ed0..75f9ff466df52bf54a07bdb8d0c3f03ff2e6eb92 100644 (file)
@@ -83,7 +83,7 @@ usage()
 
 
 char *
-read_str(FILE * f, char *buf, int max)
+read_str(FILE *f, char *buf, int max)
     /* return a pointer to string read from file f
      * if it is non-zero length */
 {
@@ -103,7 +103,7 @@ read_str(FILE * f, char *buf, int max)
 
 
 void
-delete_file(cf_t * file)
+delete_file(cf_t *file)
     /* free a file if user_name is not null 
      *   otherwise free all files */
 {
index 5c48777e20baca63e28b0d6124598b4ade8eb063..d73d0922a3f9e0435b63140d4b4464b18b818c16 100644 (file)
@@ -174,7 +174,7 @@ mktime_no_dst(struct tm *t)
 
 
 void
-run_normal_job(cl_t * line, int info_fd)
+run_normal_job(cl_t *line, int info_fd)
 /* run a job, and write "log" on info_fd if positive */
 {
 
@@ -192,7 +192,7 @@ run_normal_job(cl_t * line, int info_fd)
 }
 
 void
-run_lavg_job(lavg_t * l)
+run_lavg_job(lavg_t *l)
 {
 
     run_queue_job(l->l_line);
@@ -227,7 +227,7 @@ run_serial_job(void)
 
 
 void
-run_queue_job(cl_t * line)
+run_queue_job(cl_t *line)
     /* run a job */
 {
 
@@ -254,7 +254,7 @@ is_loop_in_queue(void)
      * Return 1 if there is a loop, 0 otherwise.
      * Only intended to be used when running in debug mode really. */
 {
-    const int max_entries = 1000000 ;
+    const int max_entries = 1000000;
     int i = 0;
     struct job_t *j;
 
@@ -272,7 +272,7 @@ is_loop_in_queue(void)
 }
 
 job_t *
-job_queue_remove(cl_t * line)
+job_queue_remove(cl_t *line)
     /* remove a job from the queue list
      * returns a pointer to the previous entry,
      * or NULL if the line either wasn't in the queue or was the first entry */
@@ -303,8 +303,8 @@ job_queue_remove(cl_t * line)
             Free_safe(j);
 
             if (debug_opt && is_loop_in_queue()) {
-                error("Loop found in job queue after removing line '%s': aborting.",
-                      line->cl_shell);
+                error("Loop found in job queue after removing line '%s': "
+                      "aborting.", line->cl_shell);
                 abort();
             }
 
@@ -317,7 +317,7 @@ job_queue_remove(cl_t * line)
 }
 
 void
-insert_nextexe(cl_t * line)
+insert_nextexe(cl_t *line)
     /* insert a job at the right position in the job queue */
 {
     struct job_t *newjob = NULL;
@@ -325,8 +325,8 @@ insert_nextexe(cl_t * line)
     struct job_t *jprev = NULL;
 
     if (debug_opt && is_loop_in_queue()) {
-        error("Detected loop in queue_base before adding job '%s' to the queue: aborting.",
-              line->cl_shell);
+        error("Detected loop in queue_base before adding job '%s' "
+              "to the queue: aborting.", line->cl_shell);
         abort();
     }
 
@@ -370,15 +370,15 @@ insert_nextexe(cl_t * line)
     }
 
     if (debug_opt && is_loop_in_queue()) {
-        error("Detected loop in queue_base after adding job '%s' to the queue: aborting.",
-               line->cl_shell);
+        error("Detected loop in queue_base after adding job '%s' to the queue:"
+              " aborting.", line->cl_shell);
         abort();
     }
 
 }
 
 void
-add_serial_job(cl_t * line, int info_fd)
+add_serial_job(cl_t *line, int info_fd)
     /* add the next queued job in serial queue */
 {
     short int i;
@@ -443,7 +443,7 @@ add_serial_job(cl_t * line, int info_fd)
 
 
 void
-add_lavg_job(cl_t * line, int info_fd)
+add_lavg_job(cl_t *line, int info_fd)
     /* add the next queued job in lavg queue */
     /* WARNING : must be run before a set_next_exe() to get the strict option
      * working correctly */
@@ -521,24 +521,24 @@ add_lavg_job(cl_t * line, int info_fd)
     if (debug_opt) {
         if (lavg_entry->l_until == 0) {
             send_msg_fd_debug(info_fd,
-                                "   lavg entry added until:none cmd: '%s'",
-                                 line->cl_shell);
+                              "   lavg entry added until:none cmd: '%s'",
+                              line->cl_shell);
         }
         else {
             struct tm ftime;
             struct tm *ft = localtime(&(lavg_entry->l_until));
 
             /* localtime() returns a statically allocated struct which might be
-                overwritten by subsequent calls: take a copy.
-                (note: localtime() is used in the debug() function too) */
+             * overwritten by subsequent calls: take a copy.
+             * (note: localtime() is used in the debug() function too) */
             memcpy(&ftime, ft, sizeof(struct tm));
 
             send_msg_fd_debug(info_fd,
-                                "   lavg entry added until:%04d-%02d-%02d "
-                                "%02d:%02d:%02d (system time) cmd: '%s'",
-                                (ftime.tm_year + 1900), (ftime.tm_mon + 1),
-                                ftime.tm_mday, ftime.tm_hour,
-                                ftime.tm_min, ftime.tm_sec, line->cl_shell);
+                              "   lavg entry added until:%04d-%02d-%02d "
+                              "%02d:%02d:%02d (system time) cmd: '%s'",
+                              (ftime.tm_year + 1900), (ftime.tm_mon + 1),
+                              ftime.tm_mday, ftime.tm_hour,
+                              ftime.tm_min, ftime.tm_sec, line->cl_shell);
         }
     }
 
@@ -702,7 +702,7 @@ set_wday(struct tm *date)
 
 
 void
-goto_beginning_next_period_periodical(cl_t * line, struct tm *ftime)
+goto_beginning_next_period_periodical(cl_t *line, struct tm *ftime)
     /* From ftime, search the first/nearest time and date of the line's next
      * period of execution.
      *
@@ -853,7 +853,7 @@ goto_beginning_next_period_periodical(cl_t * line, struct tm *ftime)
 
 
 void
-move_time_to(int where, cl_t * line, struct tm *ftime)
+move_time_to(int where, cl_t *line, struct tm *ftime)
     /* IF WHERE == BEGIN_NEXT_PERIOD: from ftime, search the first/nearest time and date
      * of the line's next period of execution.
      * IF WHERE == END_OF_INTERVAL: search the last time and date
@@ -1039,7 +1039,7 @@ move_time_to(int where, cl_t * line, struct tm *ftime)
 
 
 void
-set_next_exe(cl_t * line, char option, int info_fd)
+set_next_exe(cl_t *line, char option, int info_fd)
   /* set the cl_nextexe of a given cl_t and insert it in the queue */
 {
 
@@ -1354,7 +1354,7 @@ set_next_exe(cl_t * line, char option, int info_fd)
 }
 
 void
-set_next_exe_notrun(cl_t * line, char context)
+set_next_exe_notrun(cl_t *line, char context)
     /* set the time of the next execution and send a mail to tell user his job
      * has not run if necessary */
 {
@@ -1631,7 +1631,7 @@ set_next_exe_startup(struct cl_t *cl, const int context,
 
 
 void
-mail_notrun_time_t(cl_t * line, char context, time_t since_time_t)
+mail_notrun_time_t(cl_t *line, char context, time_t since_time_t)
 /* Same as mail_notrun() but with 'since' defined as a time_t instead of a struct tm */
 {
     struct tm *since2 = NULL;
@@ -1651,7 +1651,7 @@ mail_notrun_time_t(cl_t * line, char context, time_t since_time_t)
 }
 
 void
-mail_notrun(cl_t * line, char context, struct tm *since)
+mail_notrun(cl_t *line, char context, struct tm *since)
     /* send a mail to tell user a job has not run (and why) */
 {
     int pid = 0;
index 2ad71dbf581dd7ded58cf052186ba16469b261d7..5e488d89072a421e02e2265f959f63e3e57fab5a 100644 (file)
@@ -39,7 +39,7 @@ env_list_init(void)
 }
 
 env_list_t *
-env_list_copy(env_list_t * list)
+env_list_copy(env_list_t *list)
 {
     env_list_t *new_list = NULL;
     env_t *e = NULL;
@@ -57,7 +57,7 @@ env_list_copy(env_list_t * list)
 }
 
 env_t *
-env_list_setenv(env_list_t * list, char *name, char *value, int overwrite)
+env_list_setenv(env_list_t *list, char *name, char *value, int overwrite)
 {
     env_t e = { NULL };
     env_t *c = NULL;
@@ -89,7 +89,7 @@ env_list_setenv(env_list_t * list, char *name, char *value, int overwrite)
 }
 
 env_t *
-env_list_putenv(env_list_t * list, char *envvar, int overwrite)
+env_list_putenv(env_list_t *list, char *envvar, int overwrite)
 {
     env_t e = { NULL };
     env_t *c = NULL;
@@ -120,7 +120,7 @@ env_list_putenv(env_list_t * list, char *envvar, int overwrite)
 }
 
 char *
-env_list_getenv(env_list_t * list, char *name)
+env_list_getenv(env_list_t *list, char *name)
 {
     env_t *c = NULL;
 
@@ -141,25 +141,25 @@ env_list_getenv(env_list_t * list, char *name)
 }
 
 env_t *
-env_list_first(env_list_t * list)
+env_list_first(env_list_t *list)
 {
     return (env_t *) u_list_first((u_list_t *) list);
 }
 
 env_t *
-env_list_next(env_list_t * list)
+env_list_next(env_list_t *list)
 {
     return (env_t *) u_list_next((u_list_t *) list);
 }
 
 void
-env_list_end_iteration(env_list_t * list)
+env_list_end_iteration(env_list_t *list)
 {
     u_list_end_iteration((u_list_t *) list);
 }
 
 env_list_t *
-env_list_destroy(env_list_t * list)
+env_list_destroy(env_list_t *list)
     /* free() the memory allocated for list and returns NULL */
 {
     env_t *c = NULL;
@@ -175,7 +175,7 @@ env_list_destroy(env_list_t * list)
 }
 
 char **
-env_list_export_envp(env_list_t * list)
+env_list_export_envp(env_list_t *list)
 /* export list data as a char **envp structure to use as an argument of execle() */
 {
     env_t *c = NULL;
index 8cf03b3735393ea2fb1f5387e9484f56c8eb2c8d..4f6e4b55a3d3f657e46b9fb0adabb7edf8d8d471 100644 (file)
@@ -39,7 +39,7 @@ exe_list_init(void)
 }
 
 exe_t *
-exe_list_add_line(exe_list_t * list, struct cl_t *line)
+exe_list_add_line(exe_list_t *list, struct cl_t *line)
 {
     exe_t e = { NULL, 0, 0 };
     e.e_line = line;            /* ANSI C does not allow us to directly replace NULL by line above */
@@ -48,37 +48,37 @@ exe_list_add_line(exe_list_t * list, struct cl_t *line)
 }
 
 exe_t *
-exe_list_add(exe_list_t * list, exe_t * e)
+exe_list_add(exe_list_t *list, exe_t *e)
 {
     return (exe_t *) u_list_add((u_list_t *) list, (u_list_entry_t *) e);
 }
 
 exe_t *
-exe_list_first(exe_list_t * list)
+exe_list_first(exe_list_t *list)
 {
     return (exe_t *) u_list_first((u_list_t *) list);
 }
 
 exe_t *
-exe_list_next(exe_list_t * list)
+exe_list_next(exe_list_t *list)
 {
     return (exe_t *) u_list_next((u_list_t *) list);
 }
 
 void
-exe_list_end_iteration(exe_list_t * list)
+exe_list_end_iteration(exe_list_t *list)
 {
     u_list_end_iteration((u_list_t *) list);
 }
 
 void
-exe_list_remove_cur(exe_list_t * list)
+exe_list_remove_cur(exe_list_t *list)
 {
     u_list_remove_cur((u_list_t *) list);
 }
 
 exe_list_t *
-exe_list_destroy(exe_list_t * list)
+exe_list_destroy(exe_list_t *list)
     /* free() the memory allocated for list and returns NULL */
 {
     return (exe_list_t *) u_list_destroy((u_list_t *) list);
index cb094ee4b6c8844b00a3bcc8ead03224d6e59a50..08ed930c100684e47abf75375029c59b92129e3a 100644 (file)
@@ -10,14 +10,14 @@ pid_t daemon_pid = 0;
 uid_t rootuid = 0;
 
 void
-print_cur(exe_t * e)
+print_cur(exe_t *e)
 {
     printf("Current entry's shell command: %s\n",
            e ? e->e_line->cl_shell : "NULL");
 }
 
 void
-print_list(exe_list_t * list)
+print_list(exe_list_t *list)
 {
     exe_t *e = NULL;
     printf("Current list:\n");
diff --git a/fcron.c b/fcron.c
index 9d292a60684ac3888cf2348719a982df98a28846..ba35b0156d0da14804eea10dd3da499013251414 100644 (file)
--- a/fcron.c
+++ b/fcron.c
@@ -547,11 +547,12 @@ void
 set_signal_handler(int signal, void (*handler)(int), bool first_install)
     /* (re)install a signal handler, with restartable syscalls retried. */
 {
+/* *INDENT-OFF* */
 #ifdef HAVE_SIGACTION
     /* The signal handler stays set after the handler is called when set
-       with sigaction(): we only need to install it once. */
+     * with sigaction(): we only need to install it once. */
     if (first_install) {
-        struct sigaction act = {0};
+        struct sigaction act = { 0 };
         act.sa_flags = SA_RESTART;
         act.sa_handler = handler;
         if (sigaction(signal, &act, NULL) < 0) {
@@ -560,8 +561,8 @@ set_signal_handler(int signal, void (*handler)(int), bool first_install)
     }
 #elif defined(HAVE_SIGNAL)
     /* Some systems reset the handler to SIG_DFL when the handler
-       is called when the handler was set with signal(). So we have to install
-       it (again) every time. */
+     * is called when the handler was set with signal(). So we have to install
+     * it (again) every time. */
     if (signal(signal, handler) == SIG_ERR) {
         die_e("signal() failed on signal %d", signal);
     }
@@ -570,7 +571,7 @@ set_signal_handler(int signal, void (*handler)(int), bool first_install)
     }
 #elif defined(HAVE_SIGSET)
     /* The signal handler stays set after the handler is called when set
-       with sigset(): we only need to install it once. */
+     * with sigset(): we only need to install it once. */
     if (first_install) {
         if (sigset(signal, handler) == -1) {
             die_e("sigset() failed on signal %d", signal);
@@ -579,10 +580,12 @@ set_signal_handler(int signal, void (*handler)(int), bool first_install)
 #else
 #error "No signal installation function found"
 #endif
+/* *INDENT-ON* */
 }
 
 void
-install_signal_handler(int signal, void (*handler)(int)) {
+install_signal_handler(int signal, void (*handler)(int))
+{
     set_signal_handler(signal, handler, true);
 }
 
index d76224c81df8c9d56f3467d8b9ad22ec8a79eccc..57bad29338759a6c3e9ddfa690d27f374ad31ac2 100644 (file)
@@ -608,16 +608,16 @@ talk_fcron(char *cmd_str, int fd)
             while (printed_len < read_len) {
                 int str_len = strlen(buf + printed_len);
                 printf("%s", buf + printed_len);
-                if (str_len > 0 && buf[printed_len+str_len-1] != '\n') {
+                if (str_len > 0 && buf[printed_len + str_len - 1] != '\n') {
                     printf("\n");
                 }
-                printed_len += str_len + 1; /* +1 to account for the end-of-string '\0' marker */
+                printed_len += str_len + 1;     /* +1 to account for the end-of-string '\0' marker */
             }
 
             /* check for the end of command output marker */
             if (read_len >= sizeof(END_STR) &&
                 memcmp(&buf[read_len - sizeof(END_STR)], END_STR,
-                        sizeof(END_STR)) == 0) {
+                       sizeof(END_STR)) == 0) {
                 break;
             }
         }
index 36dfbe04bd13da035de5d034180215a7c454915a..bfbfa21c8848b321d3e7dab73670d5c911ff9920 100644 (file)
@@ -105,7 +105,7 @@ char err_others_nallowed_str[] =
 
 
 void
-fcrondyn_socket_init(select_instance * si)
+fcrondyn_socket_init(select_instance *si)
     /* do everything needed to get a working listening socket */
 {
     struct sockaddr_un addr;
@@ -401,11 +401,12 @@ print_fields(int fd, unsigned char *details)
     Add_field(field_endline);
 
     /* Extra safety (which should be redundant as strncat (used in Add_field
-       and Test_add_field) always null-terminate the string: */
+     * and Test_add_field) always null-terminate the string: */
     fields[sizeof(fields) - 1] = '\0';
 
     /* add +1 to include the final end-of-string "\0" */
-    if (send(fd, fields, (len+1 < sizeof(fields)) ? len+1 : sizeof(fields), 0) < 0)
+    if (send(fd, fields, (len + 1 < sizeof(fields)) ? len + 1 : sizeof(fields),
+             0) < 0)
         error_e("error in send()");
 
 }
@@ -470,25 +471,26 @@ print_line(int fd, struct cl_t *line, unsigned char *details, pid_t pid,
     if (bit_test(details, FIELD_SCHEDULE)) {
         ftime = localtime(&(line->cl_nextexe));
         len +=
-            snprintf(buf + len, sizeof(buf) - len, "|%04d-%02d-%02d %02d:%02d:%02d",
-                     (ftime->tm_year + 1900), (ftime->tm_mon + 1),
-                     ftime->tm_mday, ftime->tm_hour, ftime->tm_min, ftime->tm_sec);
+            snprintf(buf + len, sizeof(buf) - len,
+                     "|%04d-%02d-%02d %02d:%02d:%02d", (ftime->tm_year + 1900),
+                     (ftime->tm_mon + 1), ftime->tm_mday, ftime->tm_hour,
+                     ftime->tm_min, ftime->tm_sec);
     }
     len += snprintf(buf + len, sizeof(buf) - len, "|%s\n", line->cl_shell);
 
     /* snprintf() returns the length of what would have been written (excluding terminating null byte)
-      if not limited by maxlen */
-    if (len+1 > sizeof(buf)) {
+     * if not limited by maxlen */
+    if (len + 1 > sizeof(buf)) {
         /* the shell command string was too long and was truncated */
         strcpy(buf + sizeof(buf) - sizeof(truncated), truncated);
     }
 
     /* as extra safety to make sure the string is always null-terminated
-      (even though snprintf man page suggests it does it already) */
+     * (even though snprintf man page suggests it does it already) */
     buf[sizeof(buf) - 1] = '\0';
 
     /* add +1 to include the final end-of-string "\0" */
-    if (send(fd, buf, (len+1 < sizeof(buf)) ? len+1 : sizeof(buf), 0) < 0) {
+    if (send(fd, buf, (len + 1 < sizeof(buf)) ? len + 1 : sizeof(buf), 0) < 0) {
         error_e("error in send()");
     }
 }
@@ -547,7 +549,8 @@ cmd_ls(struct fcrondyn_cl *client, long int *cmd, int fd, int is_root)
             getloadavg(lavg, 3);
             i = snprintf(lavg_str, sizeof(lavg_str), "Current load average : "
                          "%.1f, %.1f, %.1f\n", lavg[0], lavg[1], lavg[2]);
-            send(fd, lavg_str, (i+1 < sizeof(lavg_str))? i+1 : sizeof(lavg_str), 0);
+            send(fd, lavg_str,
+                 (i + 1 < sizeof(lavg_str)) ? i + 1 : sizeof(lavg_str), 0);
 
             bit_set(fields, FIELD_LAVG);
         }
@@ -719,7 +722,7 @@ cmd_on_exeq(struct fcrondyn_cl *client, long int *cmd, int fd, int is_root)
 
 
 void
-cmd_renice(struct fcrondyn_cl *client, long int *cmd, int fd, exe_t * e,
+cmd_renice(struct fcrondyn_cl *client, long int *cmd, int fd, exe_t *e,
            int is_root)
 /* change nice value of a running job */
 {
@@ -756,7 +759,7 @@ cmd_renice(struct fcrondyn_cl *client, long int *cmd, int fd, exe_t * e,
 
 
 void
-cmd_send_signal(struct fcrondyn_cl *client, long int *cmd, int fd, exe_t * e)
+cmd_send_signal(struct fcrondyn_cl *client, long int *cmd, int fd, exe_t *e)
 /* send a signal to a running job */
 {
     if (e->e_job_pid <= 0 || (int)cmd[1] <= 0) {
@@ -860,7 +863,7 @@ exe_cmd(struct fcrondyn_cl *client)
 
 void
 remove_connection(struct fcrondyn_cl **client, struct fcrondyn_cl *prev_client,
-                  select_instance * si)
+                  select_instance *si)
 /* close the connection, remove it from the list
 and make client points to the next entry */
 {
@@ -884,7 +887,7 @@ and make client points to the next entry */
 }
 
 void
-fcrondyn_socket_check(select_instance * si)
+fcrondyn_socket_check(select_instance *si)
     /* check for new connection, command, connection closed */
 {
     int fd = -1, avoid_fd = -1;
@@ -1002,7 +1005,7 @@ fcrondyn_socket_check(select_instance * si)
 
 
 void
-fcrondyn_socket_close(select_instance * si)
+fcrondyn_socket_close(select_instance *si)
     /* close connections, close socket, remove socket file.
      * If si is not NULL, then remove the fds from si's readfds */
 {
index 7621cec958509221191abf2e5afb23d22035d19f..0fcab460f2cc03ed9be44f911671a024ef2ce66b 100644 (file)
@@ -91,8 +91,8 @@ sig_daemon(void)
     max_delay_s = MAX_FCRONTAB_RELOAD_DELAY_SECONDS;
 #endif
     if (uid == rootuid) {
-      /* we don't need to make root wait */
-      max_delay_s = 0;
+        /* we don't need to make root wait */
+        max_delay_s = 0;
     }
 
     if (max_delay_s > 0) {
@@ -108,22 +108,24 @@ sig_daemon(void)
         now_epoch = time(NULL);
 
         if (now_epoch % 60 < 50) {
-          /* clocktime is < ##:##:50, so target 10s before the end of the current minute */
-          delay_s = 50 - (now_epoch % 60);
-        } else {
-          /* clocktime is >= ##:##:50, so target 10s before the end of the next minute */
-          delay_s = 50 + (60 - (now_epoch % 60));
+            /* clocktime is < ##:##:50, so target 10s before the end of the current minute */
+            delay_s = 50 - (now_epoch % 60);
+        }
+        else {
+            /* clocktime is >= ##:##:50, so target 10s before the end of the next minute */
+            delay_s = 50 + (60 - (now_epoch % 60));
         }
 
         if (delay_s > max_delay_s) {
-          delay_s = max_delay_s;
+            delay_s = max_delay_s;
         }
 
         target_time_epoch = now_epoch + delay_s;
         target_time_tm = localtime(&target_time_epoch);
 
-        fprintf(stderr, "Modifications will be taken into account at %02d:%02d:%02d.\n",
-          target_time_tm->tm_hour, target_time_tm->tm_min, target_time_tm->tm_sec);
+        fprintf(stderr, "Modifications will be taken into account at "
+                "%02d:%02d:%02d.\n", target_time_tm->tm_hour,
+                target_time_tm->tm_min, target_time_tm->tm_sec);
 
         /* if fcrontabs is too long, snprintf will not be able to add "/fcrontab.sig"
          * string at the end of sigfile */
index 6a45476cc4ae386278b20d94fab5fa11972d7eec..f0744770c242e7a9e32b785db9ef0f2e33ed4cd7 100644 (file)
@@ -887,7 +887,7 @@ parseopt(int argc, char *argv[])
                 Set(fcronconf, optarg);
             }
             else {
-                char buf[sizeof(orig_dir)+1+strlen(optarg)+1];
+                char buf[sizeof(orig_dir) + 1 + strlen(optarg) + 1];
                 snprintf(buf, sizeof(buf), "%s/%s", orig_dir, optarg);
                 Set(fcronconf, buf);
             }
@@ -1105,7 +1105,6 @@ main(int argc, char **argv)
     if (file_opt) {
 
         if (strcmp(argv[file_opt], "-") == 0)
-
             xexit(install_stdin());
 
         else {
@@ -1113,9 +1112,11 @@ main(int argc, char **argv)
 
             if (*argv[file_opt] != '/') {
                 /* this is just the file name, not the path : complete it */
-                size_t path_len = strlen(orig_dir) + 1 + strlen(argv[file_opt]) + 1;
+                size_t path_len =
+                    strlen(orig_dir) + 1 + strlen(argv[file_opt]) + 1;
                 alloc_safe(path_len, fcrontab_file_path);
-                snprintf(fcrontab_file_path, path_len, "%s/%s", orig_dir, argv[file_opt]);
+                snprintf(fcrontab_file_path, path_len, "%s/%s", orig_dir,
+                         argv[file_opt]);
             }
             else {
                 fcrontab_file_path = strdup(argv[file_opt]);
index 589616b178e3c738f8d652ac36a1dd7d30f576a2..f6f818fff34906e9563edc293be819c75999ad74 100644 (file)
@@ -65,7 +65,7 @@ fifo_list_init(size_t entry_size, int init_size, int grow_size)
 }
 
 fifo_list_entry_t *
-fifo_list_last(fifo_list_t * l)
+fifo_list_last(fifo_list_t *l)
 /* Returns the pointer of the last entry in the list, or NULL if l is empty */
 {
     fifo_list_entry *e = NULL;
@@ -81,7 +81,7 @@ fifo_list_last(fifo_list_t * l)
 }
 
 int
-fifo_list_resize_array(fifo_list_t * l)
+fifo_list_resize_array(fifo_list_t *l)
 /* Resize l's entries_array up to l->max_entries
  * Returns OK on success, ERR if the array is already at maximum size */
 {
@@ -125,7 +125,7 @@ fifo_list_resize_array(fifo_list_t * l)
 
 
 fifo_list_entry_t *
-fifo_list_add(fifo_list_t * l, fifo_list_entry_t * e)
+fifo_list_add(fifo_list_t *l, fifo_list_entry_t *e)
 /* Add one entry to the list
  * Returns a pointer to the added element, or NULL if list is already at max size */
 {
@@ -150,7 +150,7 @@ fifo_list_add(fifo_list_t * l, fifo_list_entry_t * e)
 }
 
 fifo_list_entry_t *
-fifo_list_first(fifo_list_t * l)
+fifo_list_first(fifo_list_t *l)
 /* Return the first entry of the list (then fifo_list_next() can be used) */
 {
     /* sanity check */
@@ -167,7 +167,7 @@ fifo_list_first(fifo_list_t * l)
 }
 
 fifo_list_entry_t *
-fifo_list_next(fifo_list_t * l)
+fifo_list_next(fifo_list_t *l)
 /* Return the entry after e */
 {
     /* // WHAT IF I CALL _ADD() (+RESIZE?) OR _REMOVE() BETWEEN TWO _NEXT CALLS? */
@@ -203,7 +203,7 @@ fifo_list_next(fifo_list_t * l)
 }
 
 void
-fifo_list_end_iteration(fifo_list_t * list)
+fifo_list_end_iteration(fifo_list_t *list)
     /* Stop an iteration before _next() reached the end of the list by itself */
 {
     list->cur_entry = NULL;
@@ -212,7 +212,7 @@ fifo_list_end_iteration(fifo_list_t * list)
 
 
 void
-fifo_list_remove_first(fifo_list_t * l)
+fifo_list_remove_first(fifo_list_t *l)
 {
     /* // MANAGE L->NEXT_ENTRY (+ SPECIAL CASE FIRST/LAST ENTRY) */
     fifo_list_entry_t *last = NULL;
@@ -236,7 +236,7 @@ fifo_list_remove_first(fifo_list_t * l)
 }
 
 fifo_list_t *
-fifo_list_destroy(fifo_list_t * list)
+fifo_list_destroy(fifo_list_t *list)
     /* free() the memory allocated for list and returns NULL */
 {
     if (list == NULL)
index b6e6eaf29068dfeb23d228d478b300cf34bb09db..0bb588f5b04804f5211164e40e71c24c33f9ebc7 100644 (file)
@@ -99,7 +99,7 @@ get_string(char *ptr)
 
 
 int
-get_line(char *str, size_t size, FILE * file)
+get_line(char *str, size_t size, FILE *file)
     /* similar to fgets, but increase line if necessary,
      * and continue over an "\" followed by an "\n" char */
 {
@@ -149,7 +149,7 @@ get_line(char *str, size_t size, FILE * file)
 }
 
 void
-init_default_line(cl_t * cl, cf_t * cf)
+init_default_line(cl_t *cl, cf_t *cf)
 /* clear all context/options from cl */
 {
     bzero(cl, sizeof(cl_t));
@@ -295,7 +295,7 @@ read_file(char *filename, int fd)
 }
 
 void
-read_env(char *ptr, cf_t * cf)
+read_env(char *ptr, cf_t *cf)
     /* append env variable list.
      * (remove blanks) */
 {
@@ -500,7 +500,7 @@ get_bool(char *ptr, int *i)
 
 
 char *
-read_opt(char *ptr, cl_t * cl)
+read_opt(char *ptr, cl_t *cl)
     /* read one or several options and fill in the field "option" */
 {
     char opt_name[20];
@@ -1207,7 +1207,7 @@ read_opt(char *ptr, cl_t * cl)
 
 
 char *
-get_time(char *ptr, time_t * time, int zero_allowed)
+get_time(char *ptr, time_t *time, int zero_allowed)
     /* convert time read in string in time_t format */
 {
     time_t sum;
@@ -1262,7 +1262,7 @@ get_time(char *ptr, time_t * time, int zero_allowed)
 
 
 char *
-check_username(char *ptr, cf_t * cf, cl_t * cl)
+check_username(char *ptr, cf_t *cf, cl_t *cl)
     /* check ptr to see if the first word is a username, returns new ptr */
 {
     short int indx = 0;
@@ -1315,7 +1315,7 @@ read_word(char *ptr, char *buf, size_t buf_size)
 }
 
 int
-read_shortcut(char *ptr, cf_t * cf)
+read_shortcut(char *ptr, cf_t *cf)
 /* try to read a shortcut entry, and if it is one then append a line to cf
  * Return 1 if that was a shortcut entry. If it wasn't, return 0 and make sure
  * ptr is back to its orig value. */
@@ -1470,7 +1470,7 @@ read_shortcut(char *ptr, cf_t * cf)
 }
 
 void
-read_freq(char *ptr, cf_t * cf)
+read_freq(char *ptr, cf_t *cf)
     /* read a freq entry, and append a line to cf */
 {
     cl_t *cl = NULL;
@@ -1573,7 +1573,7 @@ read_freq(char *ptr, cf_t * cf)
 
 
 void
-read_arys(char *ptr, cf_t * cf)
+read_arys(char *ptr, cf_t *cf)
     /* read a run freq number plus a normal fcron line */
 {
     cl_t *cl = NULL;
@@ -1663,7 +1663,7 @@ read_arys(char *ptr, cf_t * cf)
 }
 
 void
-read_period(char *ptr, cf_t * cf)
+read_period(char *ptr, cf_t *cf)
     /* read a line to run periodically (i.e. once a day, once a week, etc) */
 {
     cl_t *cl = NULL;
@@ -1887,7 +1887,7 @@ get_num(char *ptr, int *num, int max, short int decimal, const char **names)
 
 
 char *
-read_field(char *ptr, bitstr_t * ary, int max, const char **names)
+read_field(char *ptr, bitstr_t *ary, int max, const char **names)
     /* read a field like "2,5-8,10-20/2,21-30~25" and fill ary */
 {
     int start = 0;
index bc601f1985dfdf5955a17c0585be166491d14c85..ae225ab247f10e46e52e096cfe4be3c3a3f6a9e1 100644 (file)
@@ -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;
 
@@ -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;
 
diff --git a/job.c b/job.c
index d60a7dbe497fc95f4be2f1fd3bae7ff4e6a5ab83..b38e09fea2dfeb837200fb5ad22dbf19c57c48ec 100644 (file)
--- a/job.c
+++ b/job.c
@@ -46,8 +46,8 @@ void become_user(struct cl_t *cl, struct passwd *pas, char *home);
 
 #ifdef HAVE_LIBPAM
 void
-die_mail_pame(cl_t * cl, int pamerrno, struct passwd *pas, char *str,
-              env_list_t * env)
+die_mail_pame(cl_t *cl, int pamerrno, struct passwd *pas, char *str,
+              env_list_t *env)
 /* log an error in syslog, mail user if necessary, and die */
 {
     char buf[MAX_MSG];
@@ -279,7 +279,7 @@ sig_dfl(void)
 }
 
 FILE *
-create_mail(cl_t * line, char *subject, char *content_type, char *encoding,
+create_mail(cl_t *line, char *subject, char *content_type, char *encoding,
             char **env)
     /* create a temp file and write in it a mail header */
 {
@@ -321,20 +321,22 @@ create_mail(cl_t * line, char *subject, char *content_type, char *encoding,
 #endif                          /* HAVE_GETHOSTNAME */
 
     /* write mail header. Global 'maildisplayname' comes from fcronconf.h */
-    if (maildisplayname[0] != '\0'){
+    if (maildisplayname[0] != '\0') {
         /* New behavior -- RFC-compliant */
-        mailbox_addr = make_mailbox_addr(maildisplayname, mailfrom, hostname_from);
-        if (! mailbox_addr) {
+        mailbox_addr =
+            make_mailbox_addr(maildisplayname, mailfrom, hostname_from);
+        if (!mailbox_addr) {
             warn("could not make the mailbox address");
         }
     }
     if (mailbox_addr) {
-        fprintf(mailf, FROM_HEADER_KEY"%s\n", mailbox_addr);
+        fprintf(mailf, FROM_HEADER_KEY "%s\n", mailbox_addr);
         Free_safe(mailbox_addr);
     }
     else {
         /* Old behavior */
-        fprintf(mailf, FROM_HEADER_KEY"%s%s (fcron)\n", mailfrom, hostname_from);
+        fprintf(mailf, FROM_HEADER_KEY "%s%s (fcron)\n", mailfrom,
+                hostname_from);
     }
 
     fprintf(mailf, "To: %s%s\n", line->cl_mailto, hostname_to);
@@ -483,7 +485,7 @@ write_pipe(int fd, void *buf, size_t size)
 }
 
 void
-run_job_grand_child_setup_stderr_stdout(cl_t * line, int *pipe_fd)
+run_job_grand_child_setup_stderr_stdout(cl_t *line, int *pipe_fd)
     /* setup stderr and stdout correctly so as the mail containing
      * the output of the job can be send at the end of the job.
      * Close the pipe (both ways). */
@@ -518,7 +520,7 @@ run_job_grand_child_setup_stderr_stdout(cl_t * line, int *pipe_fd)
 }
 
 void
-run_job_grand_child_setup_nice(cl_t * line)
+run_job_grand_child_setup_nice(cl_t *line)
     /* set the nice value for the job */
 {
     if (line->cl_nice != 0) {
@@ -783,8 +785,7 @@ run_job(struct exe_t *exeent)
 }
 
 void
-end_job(cl_t * line, int status, FILE * mailf, short mailpos,
-        char **sendmailenv)
+end_job(cl_t *line, int status, FILE *mailf, short mailpos, char **sendmailenv)
     /* if task have made some output, mail it to user */
 {
 
@@ -870,7 +871,7 @@ end_job(cl_t * line, int status, FILE * mailf, short mailpos,
 }
 
 void
-launch_mailer(cl_t * line, FILE * mailf, char **sendmailenv)
+launch_mailer(cl_t *line, FILE *mailf, char **sendmailenv)
     /* mail the output of a job to user */
 {
 #ifdef USE_SENDMAIL
diff --git a/job.h b/job.h
index 612e87d4ae63c3906d6a48b9fa069dd56737c149..970266348bcaa8c3ec0743765195f52c659b8eef 100644 (file)
--- a/job.h
+++ b/job.h
@@ -25,7 +25,7 @@
 #ifndef __JOB_H__
 #define __JOB_H__
 
-#define MAIL_LINE_LEN_MAX 998 /* RFC5322's max line length */
+#define MAIL_LINE_LEN_MAX 998   /* RFC5322's max line length */
 #define FROM_HEADER_KEY "From: "
 
 /* functions prototypes */
index 02fe0aa0e5c572069016811c1d14f2156a92fa8e..2105d42cf4dd0d18adc3cfcb3c2d2a147794765b 100644 (file)
@@ -42,7 +42,7 @@ lavg_list_init(void)
 }
 
 lavg_t *
-lavg_list_add_line(lavg_list_t * list, struct cl_t * line)
+lavg_list_add_line(lavg_list_t *list, struct cl_t *line)
 {
     lavg_t e = { NULL, 0 };
     e.l_line = line;            /* ANSI C does not allow us to directly replace NULL by line above */
@@ -51,37 +51,37 @@ lavg_list_add_line(lavg_list_t * list, struct cl_t * line)
 }
 
 lavg_t *
-lavg_list_add(lavg_list_t * list, lavg_t * entry)
+lavg_list_add(lavg_list_t *list, lavg_t *entry)
 {
     return (lavg_t *) u_list_add((u_list_t *) list, (u_list_entry_t *) entry);
 }
 
 lavg_t *
-lavg_list_first(lavg_list_t * list)
+lavg_list_first(lavg_list_t *list)
 {
     return (lavg_t *) u_list_first((u_list_t *) list);
 }
 
 lavg_t *
-lavg_list_next(lavg_list_t * list)
+lavg_list_next(lavg_list_t *list)
 {
     return (lavg_t *) u_list_next((u_list_t *) list);
 }
 
 void
-lavg_list_end_iteration(lavg_list_t * list)
+lavg_list_end_iteration(lavg_list_t *list)
 {
     u_list_end_iteration((u_list_t *) list);
 }
 
 void
-lavg_list_remove_cur(lavg_list_t * list)
+lavg_list_remove_cur(lavg_list_t *list)
 {
     u_list_remove_cur((u_list_t *) list);
 }
 
 lavg_list_t *
-lavg_list_destroy(lavg_list_t * list)
+lavg_list_destroy(lavg_list_t *list)
 {
     return (lavg_list_t *) u_list_destroy((u_list_t *) list);
 }
diff --git a/log.c b/log.c
index 4796aa7eaa12fc66d726d27326080bc63b48e0d4..f5d6346ef6fa39ee7052adb42443b0a290f6f860 100644 (file)
--- a/log.c
+++ b/log.c
@@ -246,7 +246,7 @@ xlog_e(int priority, int fd, char *fmt, va_list args)
 
 /* write a message to the file specified by logfile. */
 static void
-print_line_prefix(FILE * logfile, int priority)
+print_line_prefix(FILE *logfile, int priority)
 {
     time_t t = time(NULL);
     struct tm *ft;
@@ -285,7 +285,7 @@ print_line_prefix(FILE * logfile, int priority)
 /* Same as log_syslog(), but also appends an error description corresponding
  * to the pam_error. */
 static void
-log_pame(int priority, pam_handle_t * pamh, int pamerrno, char *fmt,
+log_pame(int priority, pam_handle_t *pamh, int pamerrno, char *fmt,
          va_list args)
 {
     char *msg;
@@ -411,7 +411,7 @@ error_e(char *fmt, ...)
 #ifdef HAVE_LIBPAM
 /* Log a "complain" level message, with a PAM error description */
 void
-error_pame(pam_handle_t * pamh, int pamerrno, char *fmt, ...)
+error_pame(pam_handle_t *pamh, int pamerrno, char *fmt, ...)
 {
     va_list args;
 
@@ -473,7 +473,7 @@ die_e(char *fmt, ...)
 #ifdef HAVE_LIBPAM
 /* Log a "complain" level message, with a PAM error description, and exit */
 void
-die_pame(pam_handle_t * pamh, int pamerrno, char *fmt, ...)
+die_pame(pam_handle_t *pamh, int pamerrno, char *fmt, ...)
 {
     va_list args;
 
diff --git a/mail.c b/mail.c
index 3428a05e23e10141952ec30e7d63d8a63a3183aa..bd06d86134651ae1d7027a2d6e31197bc959e43f 100644 (file)
--- a/mail.c
+++ b/mail.c
@@ -25,8 +25,8 @@
 #include "fcron.h"
 #include "mail.h"
 
-char
-*format_maildisplayname(char *displayname_conf)
+char *
+format_maildisplayname(char *displayname_conf)
     /* Format the input string `conf_value` according to RFC5322 sec. 3.2.3.
      * <https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.3>.
      * Returns: either the formatted displayname (possibly unchanged or empty)
@@ -35,13 +35,15 @@ char
 {
     bool need_quotes = false;
     char c = '\0';
-    char *ipos = NULL;  /* Input position */
+    char *ipos = NULL;          /* Input position */
     char *output = NULL, *quoted_output = NULL;
 
     const uint buf_len = MAIL_FROM_VALUE_LEN_MAX;
-    uint cwritten = 0;  /* how many chars we have written */
+    uint cwritten = 0;          /* how many chars we have written */
 
-    if (strlen(displayname_conf) == 0) return strdup2("");
+    if (strlen(displayname_conf) == 0) {
+        return strdup2("");
+    }
 
     output = (char *)alloc_safe(buf_len * sizeof(char), "output buffer");
 
@@ -66,10 +68,12 @@ char
     }
 
     if (need_quotes) {
-        quoted_output = (char *)alloc_safe(buf_len * sizeof(char), "quoted output buffer");
+        quoted_output =
+            (char *)alloc_safe(buf_len * sizeof(char), "quoted output buffer");
         int needed_len = snprintf(quoted_output, buf_len, "\"%s\"", output);
-        if (needed_len >= buf_len){
-            error("Formatted 'displayname' too long: length:%u > max:%u chars", needed_len, buf_len);
+        if (needed_len >= buf_len) {
+            error("Formatted 'displayname' too long: length:%u > max:%u chars",
+                  needed_len, buf_len);
             Free_safe(output);
             Free_safe(quoted_output);
             return NULL;
@@ -94,7 +98,7 @@ make_mailbox_addr(char *displayname_conf, char *mail_from, char *hostname)
     uint written = 0;
     bool need_anglebrackets = false;
 
-    const uint buf_len = MAIL_FROM_VALUE_LEN_MAX+1;
+    const uint buf_len = MAIL_FROM_VALUE_LEN_MAX + 1;
 
     buf = (char *)alloc_safe(buf_len * sizeof(char), "mailbox addr buffer");
 
diff --git a/mail.h b/mail.h
index 4dd5cfa579816172f5804db6bbad4577592ad72e..d1e9bb7d407b4d2aab6463ab6d755c1ad5488709 100644 (file)
--- a/mail.h
+++ b/mail.h
 #ifndef __MAIL_H__
 #define __MAIL_H__
 
-#define MAIL_LINE_LEN_MAX 998 /* RFC5322's max line length */
+#define MAIL_LINE_LEN_MAX 998   /* RFC5322's max line length */
 #define FROM_HEADER_KEY "From: "
 #define MAIL_FROM_VALUE_LEN_MAX (MAIL_LINE_LEN_MAX - sizeof(FROM_HEADER_KEY))
 
 extern char *format_maildisplayname(char *displayname_conf);
-extern char *make_mailbox_addr(char *displayname_conf, char *mail_from, char *hostname);
+extern char *make_mailbox_addr(char *displayname_conf, char *mail_from,
+                               char *hostname);
 
 #endif                          /* __MAIL_H__ */
diff --git a/save.c b/save.c
index e5ddb5ba9e4c1bf24297d3e67cda9979ecf13b76..37511596781f539787b5a5cd36eb0b24dd81be84 100644 (file)
--- a/save.c
+++ b/save.c
@@ -325,7 +325,7 @@ write_file_to_disk(int fd, struct cf_t *file, time_t time_date)
 
 
 int
-save_one_file(cf_t * file, char *filename, uid_t own_uid, gid_t own_gid,
+save_one_file(cf_t *file, char *filename, uid_t own_uid, gid_t own_gid,
               time_t save_date)
 /* save a given file to disk */
 {
@@ -374,7 +374,7 @@ save_one_file(cf_t * file, char *filename, uid_t own_uid, gid_t own_gid,
 
 
 int
-save_file_safe(cf_t * file, char *final_path, char *prog_name, uid_t own_uid,
+save_file_safe(cf_t *file, char *final_path, char *prog_name, uid_t own_uid,
                gid_t own_gid, time_t save_date)
 /* save a file to a temp path, and then rename it (safely) to avoid loss of data
  * if a system crash, hardware failure, etc happens. */
index a81b10cf3976d5a27757e133970338e1d7c88b04..0bf4a6a2bda16ba767e2ca27cefe4852c082364e 100644 (file)
--- a/select.c
+++ b/select.c
@@ -39,7 +39,7 @@ select_init(struct select_instance *si)
 }
 
 void
-select_add_read(select_instance * si, int fd)
+select_add_read(select_instance *si, int fd)
     /* Add a fd to the read set */
 {
     FD_SET(fd, &si->__readfds_master);
@@ -51,7 +51,7 @@ select_add_read(select_instance * si, int fd)
 }
 
 void
-select_rm_read(select_instance * si, int fd)
+select_rm_read(select_instance *si, int fd)
     /* remove a fd to the read set */
 {
     FD_CLR(fd, &si->__readfds_master);
diff --git a/subs.c b/subs.c
index 905ceed2f5cef0d10df13238b4e2105cd35d8c08..8d88d3e8978556231d2416570c4d8693a4fe4f5b 100644 (file)
--- a/subs.c
+++ b/subs.c
@@ -414,7 +414,6 @@ my_setenv_overwrite(const char *name, const char *value)
     char buf[PATH_LEN];
 
     snprintf(buf, sizeof(buf) - 1, "%s=%s", name, value)
-
         /* The final \0 may not have been copied because of lack of space:
          * add it to make sure */
         buf[sizeof(buf) - 1] = '\0';
index ac0f24dde2c1b71ba1ad4c8ef57704ba06d76810..dbe74b75153c538f0aa1cb2b51a955843cce2d83 100644 (file)
--- a/suspend.c
+++ b/suspend.c
@@ -211,7 +211,7 @@ read_suspend_duration(time_t slept_from)
 }
 
 void
-init_suspend(select_instance * si)
+init_suspend(select_instance *si)
 {
 
 #if defined(CLOCK_BOOTTIME) && defined(CLOCK_MONOTONIC)
@@ -245,7 +245,7 @@ init_suspend(select_instance * si)
 
 void
 check_suspend(time_t slept_from, time_t nwt, bool *sig_cont,
-              select_instance * si)
+              select_instance *si)
     /* Check if the machine was suspended (to mem or disk), and if so
      * reschedule jobs accordingly */
 {
@@ -305,8 +305,8 @@ check_suspend(time_t slept_from, time_t nwt, bool *sig_cont,
         long int scheduled_sleep = nwt - slept_from;
 
         explain("suspend/hibernate detected: The system was suspended for "
-        "%lus (and we woke up after %lus instead of our intended %lus sleep).",
-        suspend_duration, actual_sleep, scheduled_sleep);
+                "%lus (and we woke up after %lus instead of our intended %lus sleep).",
+                suspend_duration, actual_sleep, scheduled_sleep);
         reschedule_all_on_resume(suspend_duration);
     }
 }
index addbbfea1e1c797eef5d4a3bf9e02f7f6185cfff..6828c96b399907cc80991c337266f70c039e9bc4 100644 (file)
--- a/u_list.c
+++ b/u_list.c
@@ -65,7 +65,7 @@ u_list_init(size_t entry_size, int init_size, int grow_size)
 }
 
 u_list_t *
-u_list_copy(u_list_t * list)
+u_list_copy(u_list_t *list)
 {
     u_list_t *new_list = NULL;
 
@@ -87,7 +87,7 @@ u_list_copy(u_list_t * list)
 
 
 int
-u_list_resize_array(u_list_t * l)
+u_list_resize_array(u_list_t *l)
 /* Resize l's entries_array up to l->max_entries
  * Returns OK on success, ERR if the array is already at maximum size */
 {
@@ -130,7 +130,7 @@ u_list_resize_array(u_list_t * l)
 }
 
 u_list_entry_t *
-u_list_last(u_list_t * l)
+u_list_last(u_list_t *l)
 /* Returns the pointer of the last entry in the list, or NULL if l is empty */
 {
     if (l->num_entries <= 0)
@@ -141,7 +141,7 @@ u_list_last(u_list_t * l)
 }
 
 u_list_entry_t *
-u_list_add(u_list_t * l, u_list_entry_t * e)
+u_list_add(u_list_t *l, u_list_entry_t *e)
 /* Add one entry to the list
  * Returns a pointer to the added element, or NULL if list is already at max size */
 {
@@ -166,7 +166,7 @@ u_list_add(u_list_t * l, u_list_entry_t * e)
 }
 
 int
-u_list_is_iterating(u_list_t * l)
+u_list_is_iterating(u_list_t *l)
 {
     /* sanity check */
     if (l == NULL)
@@ -176,7 +176,7 @@ u_list_is_iterating(u_list_t * l)
 }
 
 u_list_entry_t *
-u_list_first(u_list_t * l)
+u_list_first(u_list_t *l)
 /* Return the first entry of the list (then u_list_next() can be used) */
 {
     /* sanity check */
@@ -193,7 +193,7 @@ u_list_first(u_list_t * l)
 }
 
 u_list_entry_t *
-u_list_next(u_list_t * l)
+u_list_next(u_list_t *l)
 /* Return the entry after e */
 {
     /* sanity checks */
@@ -227,7 +227,7 @@ u_list_next(u_list_t * l)
 }
 
 void
-u_list_end_iteration(u_list_t * list)
+u_list_end_iteration(u_list_t *list)
     /* Stop an iteration before _next() reached the end of the list by itself */
 {
     list->cur_entry = NULL;
@@ -236,7 +236,7 @@ u_list_end_iteration(u_list_t * list)
 
 
 void
-u_list_remove_cur(u_list_t * l)
+u_list_remove_cur(u_list_t *l)
 {
     u_list_entry_t *last = NULL;
 
@@ -259,7 +259,7 @@ u_list_remove_cur(u_list_t * l)
 }
 
 u_list_t *
-u_list_destroy(u_list_t * list)
+u_list_destroy(u_list_t *list)
     /* free() the memory allocated for list and returns NULL */
 {
     if (list == NULL)