This will make indent(1) program not to think it is a clause.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* minute until caught up.
*/
Debug(DSCH, ("[%ld], normal case %d minutes to go\n",
- (long) pid, timeDiff))
+ (long) pid, timeDiff));
do {
if (job_runqueue())
sleep(10);
* housekeeping.
*/
Debug(DSCH, ("[%ld], DST begins %d minutes to go\n",
- (long) pid, timeDiff))
+ (long) pid, timeDiff));
/* run wildcard jobs for current minute */
find_jobs(timeRunning, &database, TRUE, FALSE, GMToff);
* change until we are caught up.
*/
Debug(DSCH, ("[%ld], DST ends %d minutes to go\n",
- (long) pid, timeDiff))
+ (long) pid, timeDiff));
find_jobs(timeRunning, &database, TRUE, FALSE, GMToff);
break;
default:
* other: time has changed a *lot*,
* jump virtual time, and run everything
*/
- Debug(DSCH, ("[%ld], clock jumped\n", (long) pid))
+ Debug(DSCH, ("[%ld], clock jumped\n", (long) pid));
virtualTime = timeRunning;
oldGMToff = GMToff;
find_jobs(timeRunning, &database, TRUE, TRUE, GMToff);
Debug(DSCH, ("[%ld] tick(%d,%d,%d,%d,%d) %s %s\n",
(long) getpid(), minute, hour, dom, month, dow,
- doWild ? " " : "No wildcard", doNonWild ? " " : "Wildcard only"))
+ doWild ? " " : "No wildcard", doNonWild ? " " : "Wildcard only"));
/* the dom/dow situation is odd. '* * 1,15 * Sun' will run on the
* first and fifteenth AND every Sunday; '* * * * Sun' will run *only*
* on Sundays; '* * 1,15 * *' will run *only* the 1st and 15th. this
for (e = u->crontab; e != NULL; e = e->next) {
Debug(DSCH | DEXT, ("user [%s:%ld:%ld:...] cmd=\"%s\"\n",
e->pwd->pw_name, (long) e->pwd->pw_uid,
- (long) e->pwd->pw_gid, e->cmd))
+ (long) e->pwd->pw_gid, e->cmd));
uname = e->pwd->pw_name;
/* check if user exists in time of job is being run f.e. ldap */
if (getpwnam(uname) != NULL) {
if (initialize || tm.tm_isdst != isdst) {
isdst = tm.tm_isdst;
GMToff = get_gmtoff(&StartTime, &tm);
- Debug(DSCH, ("[%ld] GMToff=%ld\n", (long) getpid(), (long) GMToff))
+ Debug(DSCH, ("[%ld] GMToff=%ld\n", (long) getpid(), (long) GMToff));
}
clockTime = (StartTime + GMToff) / (time_t) SECONDS_PER_MINUTE;
}
seconds_to_wait = (int) (target * SECONDS_PER_MINUTE - t1) + 1;
Debug(DSCH, ("[%ld] Target time=%ld, sec-to-wait=%d\n",
(long) getpid(), (long) target * SECONDS_PER_MINUTE,
- seconds_to_wait))
+ seconds_to_wait));
while (seconds_to_wait > 0 && seconds_to_wait < 65) {
sleep((unsigned int) seconds_to_wait);
case -1:
if (errno == EINTR)
continue;
- Debug(DPROC, ("[%ld] sigchld...no children\n", (long) getpid()))
+ Debug(DPROC, ("[%ld] sigchld...no children\n", (long) getpid()));
break;
case 0:
- Debug(DPROC, ("[%ld] sigchld...no dead kids\n", (long) getpid()))
+ Debug(DPROC, ("[%ld] sigchld...no dead kids\n", (long) getpid()));
break;
default:
Debug(DPROC,
("[%ld] sigchld...pid #%ld died, stat=%d\n",
- (long) getpid(), (long) pid, WEXITSTATUS(waiter)))
+ (long) getpid(), (long) pid, WEXITSTATUS(waiter)));
break;
}
} while (pid > 0);
}
Debug(DMISC, ("user=%s, file=%s, option=%s\n",
- User, Filename, Options[(int) Option]))
+ User, Filename, Options[(int) Option]));
}
static void list_cmd(void) {
if ((crontab_fd = check_open(tabname, uname, pw, &mtime)) == -1)
goto next_crontab;
- Debug(DLOAD, ("\t%s:", fname))
+ Debug(DLOAD, ("\t%s:", fname));
if (old_db != NULL)
u = find_user(old_db, fname, crond_crontab ? tabname : NULL); /* find user in old_db */
* in, then we can just use our existing entry.
*/
if (u->mtime == mtime) {
- Debug(DLOAD, (" [no change, using old data]"))
+ Debug(DLOAD, (" [no change, using old data]"));
unlink_user(old_db, u);
link_user(new_db, u);
goto next_crontab;
* users will be deleted from the old database when
* we finish with the crontab...
*/
- Debug(DLOAD, (" [delete old data]"))
+ Debug(DLOAD, (" [delete old data]"));
unlink_user(old_db, u);
free_user(u);
log_it(fname, getpid(), "RELOAD", tabname, 0);
next_crontab:
if (crontab_fd != -1) {
- Debug(DLOAD, (" [done]\n"))
+ Debug(DLOAD, (" [done]\n"));
close(crontab_fd);
}
}
}
overwrite_database(old_db, &new_db);
- Debug(DLOAD, ("check_inotify_database is done\n"))
+ Debug(DLOAD, ("check_inotify_database is done\n"));
}
#endif
user *u, *nu;
/* whatever's left in the old database is now junk.
*/
- Debug(DLOAD, ("unlinking old database:\n"))
+ Debug(DLOAD, ("unlinking old database:\n"));
for (u = old_db->head; u != NULL; u = nu) {
- Debug(DLOAD, ("\t%s\n", u->name))
+ Debug(DLOAD, ("\t%s\n", u->name));
nu = u->next;
unlink_user(old_db, u);
free_user(u);
pid_t pid = getpid();
int is_local = 0;
- Debug(DLOAD, ("[%ld] load_database()\n", (long) pid))
+ Debug(DLOAD, ("[%ld] load_database()\n", (long) pid));
/* before we start loading any data, do a stat on SPOOL_DIR
* so that if anything changes as of this moment (i.e., before we've
TMAX(statbuf.st_mtime, syscron_stat.st_mtime))
) {
Debug(DLOAD, ("[%ld] spool dir mtime unch, no load needed.\n",
- (long) pid))
+ (long) pid));
return 0;
}
endpwent();
overwrite_database(old_db, &new_db);
- Debug(DLOAD, ("load_database is done\n"))
+ Debug(DLOAD, ("load_database is done\n"));
return 1;
}
Debug(DPROC, ("[%ld] do_command(%s, (%s,%ld,%ld))\n",
(long) pid, e->cmd, u->name,
- (long) e->pwd->pw_uid, (long) e->pwd->pw_gid))
+ (long) e->pwd->pw_uid, (long) e->pwd->pw_gid));
/* fork to become asynchronous -- parent process is done immediately,
* and continues to run the normal cron code, which means return to
ev = child_process(e, jobenv);
cron_close_pam();
env_free(jobenv);
- Debug(DPROC, ("[%ld] child process done, exiting\n", (long) getpid()))
+ Debug(DPROC, ("[%ld] child process done, exiting\n", (long) getpid()));
_exit(ev);
break;
default:
/* parent process */
break;
}
- Debug(DPROC, ("[%ld] main process returning to work\n", (long) pid))
+ Debug(DPROC, ("[%ld] main process returning to work\n", (long) pid));
}
static int child_process(entry * e, char **jobenv) {
sigaction(SIGCHLD, &sa, NULL);
- Debug(DPROC, ("[%ld] child_process('%s')\n", (long) getpid(), e->cmd))
+ Debug(DPROC, ("[%ld] child_process('%s')\n", (long) getpid(), e->cmd));
#ifdef CAPITALIZE_FOR_PS
/* mark ourselves as different to PS command watchers by upshifting
* our program name. This has no effect on some kernels.
return ERROR_EXIT;
/*NOTREACHED*/
case 0:
- Debug(DPROC, ("[%ld] grandchild process fork()'ed\n", (long) getpid()))
+ Debug(DPROC, ("[%ld] grandchild process fork()'ed\n", (long) getpid()));
/* write a log message. we've waited this long to do it
* because it was not until now that we knew the PID that
* the user's command.
*/
- Debug(DPROC, ("[%ld] child continues, closing pipes\n", (long) getpid()))
+ Debug(DPROC, ("[%ld] child continues, closing pipes\n", (long) getpid()));
/* close the ends of the pipe that will only be referenced in the
* grandchild process...
int ch;
Debug(DPROC, ("[%ld] child2 sending data to grandchild\n",
- (long) getpid()))
+ (long) getpid()));
/* reset the SIGPIPE back to default so the child will terminate
* if it tries to write to a closed pipe
fclose(out);
Debug(DPROC, ("[%ld] child2 done sending to grandchild\n",
- (long) getpid()))
+ (long) getpid()));
_exit(0);
}
*/
Debug(DPROC, ("[%ld] child reading output from grandchild\n",
- (long) getpid()))
+ (long) getpid()));
/*local */ {
FILE *in = fdopen(stdout_pipe[READ_PIPE], "r");
Debug(DPROC | DEXT,
("[%ld] got data (%x:%c) from grandchild\n",
- (long) getpid(), ch, ch))
+ (long) getpid(), ch, ch));
/* get name of recipient. this is MAILTO if set to a
* valid local username; USER otherwise.
*/
if (mail) {
- Debug(DPROC, ("[%ld] closing pipe to mail\n", (long) getpid()))
+ Debug(DPROC, ("[%ld] closing pipe to mail\n", (long) getpid()));
/* Note: the pclose will probably see
* the termination of the grandchild
* in addition to the mail process, since
} /*if data from grandchild */
- Debug(DPROC, ("[%ld] got EOF from grandchild\n", (long) getpid()))
+ Debug(DPROC, ("[%ld] got EOF from grandchild\n", (long) getpid()));
fclose(in); /* also closes stdout_pipe[READ_PIPE] */
}
PID_T child;
Debug(DPROC, ("[%ld] waiting for grandchild #%d to finish\n",
- (long) getpid(), children))
+ (long) getpid(), children));
while ((child = wait(&waiter)) < OK && errno == EINTR) ;
if (child < OK) {
Debug(DPROC,
("[%ld] no more grandchildren--mail written?\n",
- (long) getpid()))
+ (long) getpid()));
break;
}
Debug(DPROC, ("[%ld] grandchild #%ld finished, status=%04x",
- (long) getpid(), (long) child, WEXITSTATUS(waiter)))
+ (long) getpid(), (long) child, WEXITSTATUS(waiter)));
if (WIFSIGNALED(waiter) && WCOREDUMP(waiter))
- Debug(DPROC, (", dumped core"))
- Debug(DPROC, ("\n"))
+ Debug(DPROC, (", dumped core"));
+ Debug(DPROC, ("\n"));
}
return OK_EXIT;
}
char envstr[MAX_ENVSTR];
char **tenvp;
- Debug(DPARS, ("load_entry()...about to eat comments\n"))
+ Debug(DPARS, ("load_entry()...about to eat comments\n"));
skip_comments(file);
}
}
else {
- Debug(DPARS, ("load_entry()...about to parse numerics\n"))
+ Debug(DPARS, ("load_entry()...about to parse numerics\n"));
if (ch == '*')
e->flags |= MIN_STAR;
if (!pw) {
char *username = cmd; /* temp buffer */
- Debug(DPARS, ("load_entry()...about to parse username\n"))
+ Debug(DPARS, ("load_entry()...about to parse username\n"));
ch = get_string(username, MAX_COMMAND, file, " \t\n");
- Debug(DPARS, ("load_entry()...got %s\n", username))
+ Debug(DPARS, ("load_entry()...got %s\n", username));
if (ch == EOF || ch == '\n' || ch == '*') {
ecode = e_cmd;
goto eof;
goto eof;
}
Debug(DPARS, ("load_entry()...uid %ld, gid %ld\n",
- (long) pw->pw_uid, (long) pw->pw_gid))
+ (long) pw->pw_uid, (long) pw->pw_gid));
}
if ((e->pwd = pw_dup(pw)) == NULL) {
log_it("CRON", getpid(), "ERROR", "can't set USER", 0);
#endif
- Debug(DPARS, ("load_entry()...about to parse command\n"))
+ Debug(DPARS, ("load_entry()...about to parse command\n"));
/* Everything up to the next \n or EOF is part of the command...
* too bad we don't know in advance how long it will be, since we
goto eof;
}
- Debug(DPARS, ("load_entry()...returning successfully\n"))
+ Debug(DPARS, ("load_entry()...returning successfully\n"));
/* success, fini, return pointer to the entry we just created...
*/
* assume the same thing.
*/
- Debug(DPARS | DEXT, ("get_list()...entered\n"))
+ Debug(DPARS | DEXT, ("get_list()...entered\n"));
/* list = range {"," range}
*/
Skip_Nonblanks(ch, file)
Skip_Blanks(ch, file)
- Debug(DPARS | DEXT, ("get_list()...exiting w/ %02x\n", ch))
+ Debug(DPARS | DEXT, ("get_list()...exiting w/ %02x\n", ch));
return (ch);
}
int i, num1, num2, num3;
- Debug(DPARS | DEXT, ("get_range()...entering, exit won't show\n"))
+ Debug(DPARS | DEXT, ("get_range()...entering, exit won't show\n"));
if (ch == '*') {
/* '*' means "first-last" but can still be modified by /step
if (len != 0 && strchr(terms, ch)) {
for (i = 0; names[i] != NULL; i++) {
Debug(DPARS | DEXT,
- ("get_num, compare(%s,%s)\n", names[i], temp))
+ ("get_num, compare(%s,%s)\n", names[i], temp));
if (!strcasecmp(names[i], temp)) {
*numptr = i + low;
return (ch);
}
static int set_element(bitstr_t * bits, int low, int high, int number) {
- Debug(DPARS | DEXT, ("set_element(?,%d,%d,%d)\n", low, high, number))
+ Debug(DPARS | DEXT, ("set_element(?,%d,%d,%d)\n", low, high, number));
if (number < low || number > high)
return (EOF);
if (EOF == get_string(envstr, MAX_ENVSTR, f, "\n"))
return (ERR);
- Debug(DPARS, ("load_env, read <%s>\n", envstr))
+ Debug(DPARS, ("load_env, read <%s>\n", envstr));
memset(name, 0, sizeof name);
memset(val, 0, sizeof val);
}
}
if (state != FINI && !(state == VALUE && !quotechar)) {
- Debug(DPARS, ("load_env, not an env var, state = %d\n", state))
+ Debug(DPARS, ("load_env, not an env var, state = %d\n", state));
fseek(f, filepos, 0);
Set_LineNum(fileline);
return (FALSE);
*/
if (!glue_strings(envstr, MAX_ENVSTR, name, val, '='))
return (FALSE);
- Debug(DPARS, ("load_env, <%s> <%s> -> <%s>\n", name, val, envstr))
+ Debug(DPARS, ("load_env, <%s> <%s> -> <%s>\n", name, val, envstr));
return (TRUE);
}
#if DEBUGGING
# define Debug(mask, message) \
if ((DebugFlags & (mask)) != 0) \
- printf message;
+ printf message
#else /* !DEBUGGING */
# define Debug(mask, message) \
- ;
+ ()
#endif /* DEBUGGING */
#define MkUpper(ch) (islower(ch) ? toupper(ch) : ch)
* Ensure that these jobs never run in the same minute:
*/
minutely_time = time(0);
- Debug(DSCH, ("Minute-ly job. Recording time %lu\n", minutely_time))
+ Debug(DSCH, ("Minute-ly job. Recording time %lu\n", minutely_time));
}
#ifdef WITH_PAM
return (NULL);
}
- Debug(DPARS, ("load_user()\n"))
+ Debug(DPARS, ("load_user()\n"));
/* file is open. build user entry, then read the crontab file.
*/
if ((u = (user *) malloc (sizeof (user))) == NULL)
if (envp)
env_free(envp);
fclose(file);
- Debug(DPARS, ("...load_user() done\n"))
+ Debug(DPARS, ("...load_user() done\n"));
errno = save_errno;
return (u);
}