From a5246e5d0e530e0173dcb2365d599c40ed095b60 Mon Sep 17 00:00:00 2001 From: thib Date: Sat, 30 Dec 2000 12:54:19 +0000 Subject: [PATCH] removed some '' to make the log more readable --- conf.c | 39 +++++++++++++------------ database.c | 16 +++++----- fcron.c | 8 ++--- fcrontab.c | 24 +++++++-------- fileconf.c | 86 +++++++++++++++++++++++++++--------------------------- job.c | 24 +++++++-------- 6 files changed, 99 insertions(+), 98 deletions(-) diff --git a/conf.c b/conf.c index 8467866..e945268 100644 --- a/conf.c +++ b/conf.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: conf.c,v 1.33 2000-12-23 20:17:17 thib Exp $ */ + /* $Id: conf.c,v 1.34 2000-12-30 12:55:17 thib Exp $ */ #include "fcron.h" @@ -82,7 +82,7 @@ synchronize_dir(const char *dir_name) if ( strcmp(dir_name, ".") == 0 ) explain("updating configuration from " FCRONTABS ); else - explain("updating configuration from '%s'", dir_name); + explain("updating configuration from %s", dir_name); if ((dir = opendir("."))) { while ((den = readdir(dir))) { @@ -127,31 +127,31 @@ synchronize_dir(const char *dir_name) /* begin by adding normal files, if any, to database */ for (list_cur = file_list; list_cur; list_cur = list_cur->next ) { if ( getpwnam(list_cur->str) ) { - explain("adding file '%s'", list_cur->str); + explain("adding file %s", list_cur->str); synchronize_file(list_cur->str); } else - error("ignoring file '%s' : not in passwd file.", list_cur->str); + error("ignoring file \"%s\" : not in passwd file.", list_cur->str); } /* then remove files which are no longer wanted */ for (list_cur = rm_list; list_cur; list_cur = list_cur->next ) { - explain("removing file '%s'", list_cur->str + 3); + explain("removing file %s", list_cur->str + 3); delete_file(list_cur->str + 3); /* len("rm.") = 3 */ if ( remove(list_cur->str + 3) != 0 && errno != ENOENT ) - error_e("Could not remove '%s'", list_cur->str + 3); + error_e("Could not remove %s", list_cur->str + 3); if ( remove(list_cur->str) != 0 && errno != ENOENT ) - error_e("Could not remove '%s'", list_cur->str); + error_e("Could not remove %s", list_cur->str); } /* finally add new files */ for (list_cur = new_list; list_cur; list_cur = list_cur->next ) { if ( getpwnam(list_cur->str + 4) ) { /* len("new.") = 4 */ - explain("adding new file '%s'", list_cur->str + 4); + explain("adding new file %s", list_cur->str + 4); synchronize_file(list_cur->str); } else - error("ignoring file '%s' : not in passwd file.", + error("ignoring file %s : not in passwd file.", (list_cur->str + 4)); } @@ -419,7 +419,7 @@ read_file(const char *file_name, CF *cf) strncmp(buf, "fcrontab-"FILEVERSION"\n", sizeof("fcrontab-"FILEVERSION"\n")) != 0) { - error("File '%s' is not valid: ignored.", file_name); + error("File %s is not valid: ignored.", file_name); error("Maybe this file has been generated by an old version" " of fcron. In this case, you should install it again" " using fcrontab."); @@ -443,7 +443,7 @@ read_file(const char *file_name, CF *cf) /* read env variables */ Alloc(env, env_t); while( (env->e_val = read_str(ff, buf, sizeof(buf))) != NULL ) { - debug(" Env: '%s'", env->e_val ); + debug(" Env: \"%s\"", env->e_val ); env->e_next = cf->cf_env_base; cf->cf_env_base = env; @@ -492,7 +492,7 @@ read_file(const char *file_name, CF *cf) insert_nextexe(cl); } else { if ( cl->cl_timefreq < 60 ) { - error("Invalid timefreq in '%s': set to 1 day", cl->cl_shell); + error("Invalid timefreq in %s: set to 1 day", cl->cl_shell); cl->cl_timefreq = 3600*24; } cl->cl_nextexe += slept; @@ -511,7 +511,7 @@ read_file(const char *file_name, CF *cf) else { /* job has been stopped during execution : * launch it again */ - warn("job '%s' has not terminated : executed again now.", + warn("job %s has not terminated : executed again now.", cl->cl_shell); set_serial_once(cl->cl_option); add_serial_job(cl); @@ -521,7 +521,7 @@ read_file(const char *file_name, CF *cf) if (debug_opt) { struct tm *ftime; ftime = localtime( &(cl->cl_nextexe) ); - debug(" cmd '%s' next exec %d/%d/%d wday:%d %02d:%02d", + debug(" cmd %s next exec %d/%d/%d wday:%d %02d:%02d", cl->cl_shell, (ftime->tm_mon + 1), ftime->tm_mday, (ftime->tm_year + 1900), ftime->tm_wday, ftime->tm_hour, ftime->tm_min); @@ -535,14 +535,14 @@ read_file(const char *file_name, CF *cf) } /* check for an error */ if ( ferror(ff) != 0 ) - error("file '%s' is truncated : you should reinstall it", file_name); + error("file %s is truncated : you should reinstall it", file_name); /* free last calloc : unused */ free(cl); /* // if (fgets(buf, sizeof(buf), ff) == NULL || */ /* // strncmp(buf, "eof\n", sizeof("eof\n")) != 0) */ -/* // error("file '%s' is truncated : you should reinstall it",file_name); */ +/* // error("file %s is truncated : you should reinstall it",file_name); */ fclose(ff); @@ -596,7 +596,7 @@ delete_file(const char *user_name) i = 0; while (i < lavg_num) if ( lavg_array[i].l_line->cl_file == file ) { - debug("removing '%s' from lavg queue", + debug("removing %s from lavg queue", lavg_array[i].l_line->cl_shell); lavg_array[i].l_line->cl_numexe--; if (i < --lavg_num) { @@ -614,7 +614,7 @@ delete_file(const char *user_name) if (serial_array[i] != NULL && serial_array[i]->cl_file == file ) { if ( ! s_a ) s_a = calloc(serial_array_size, sizeof(CL *)); - debug("removing '%s' from serial queue", + debug("removing %s from serial queue", serial_array[i]->cl_shell); serial_num--; serial_array[i]->cl_numexe--; @@ -730,7 +730,7 @@ save_file(CF *file, char *path) /* chown the file to root:root : this file should only be read and * modified by fcron (not fcrontab) */ if (fchown(fileno(f), 0, 0) != 0) - error_e("Could not fchown '%s'", (path) ? path : file->cf_user); + error_e("Could not fchown \"%s\"", (path) ? path : file->cf_user); /* save file : */ @@ -764,6 +764,7 @@ save_file(CF *file, char *path) fclose(f); if (file != NULL) + /* we have to save only a single file */ break ; } diff --git a/database.c b/database.c index 6eb70d7..b36d753 100644 --- a/database.c +++ b/database.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: database.c,v 1.41 2000-12-10 20:29:25 thib Exp $ */ + /* $Id: database.c,v 1.42 2000-12-30 12:55:38 thib Exp $ */ #include "fcron.h" @@ -76,7 +76,7 @@ run_normal_job(CL *line) run_queue_job(line); } else { - warn(" process already running: %s '%s'", + warn(" process already running: %s %s", line->cl_file->cf_user, line->cl_shell ); @@ -593,7 +593,7 @@ goto_non_matching(CL *line, struct tm *ftime) } if (debug_opt) set_wday(ftime); - debug(" '%s' first non matching %d/%d/%d wday:%d %02d:%02d", + debug(" %s first non matching %d/%d/%d wday:%d %02d:%02d", line->cl_shell, (ftime->tm_mon + 1), ftime->tm_mday, (ftime->tm_year + 1900), ftime->tm_wday, ftime->tm_hour, ftime->tm_min); @@ -672,7 +672,7 @@ goto_non_matching(CL *line, struct tm *ftime) } } - debug(" '%s' first non matching %d/%d/%d wday:%d %02d:%02d", + debug(" %s first non matching %d/%d/%d wday:%d %02d:%02d", line->cl_shell, (ftime->tm_mon + 1), ftime->tm_mday, (ftime->tm_year + 1900), ftime->tm_wday, ftime->tm_hour, ftime->tm_min); @@ -843,7 +843,7 @@ set_next_exe(CL *line, char is_new_line) line->cl_nextexe = mktime(&ftime); if ( ! is_new_line ) - debug(" cmd: '%s' next exec %d/%d/%d wday:%d %02d:%02d", + debug(" cmd: %s next exec %d/%d/%d wday:%d %02d:%02d", line->cl_shell, (ftime.tm_mon + 1), ftime.tm_mday, (ftime.tm_year + 1900), ftime.tm_wday, ftime.tm_hour, ftime.tm_min); @@ -852,7 +852,7 @@ set_next_exe(CL *line, char is_new_line) else { /* this is a job based on system up time */ line->cl_nextexe = now + line->cl_timefreq; - debug(" cmd: '%s' next exec in %lds", line->cl_shell, + debug(" cmd: %s next exec in %lds", line->cl_shell, line->cl_timefreq); } @@ -887,7 +887,7 @@ check_lavg(time_t lim) /* first, check if some lines must be executed because of until */ while ( i < lavg_num ) if ( lavg_array[i].l_line->cl_until && lavg_array[i].l_until < now ) { - debug("until '%s' %d", lavg_array[i].l_line->cl_shell, + debug("until %s %d", lavg_array[i].l_line->cl_shell, lavg_array[i].l_until); run_lavg_job(i); } else @@ -926,7 +926,7 @@ check_lavg(time_t lim) || l_avg[2] < lavg_array[i].l_line->cl_lavg[2] ) ) ) { - debug("lavg '%s' %s %.0f:%d %.0f:%d %.0f:%d", + debug("lavg %s %s %.0f:%d %.0f:%d %.0f:%d", lavg_array[i].l_line->cl_shell, (is_lor(lavg_array[i].l_line->cl_option)) ? "or" : "and", l_avg[0], lavg_array[i].l_line->cl_lavg[0], diff --git a/fcron.c b/fcron.c index f34e65b..795bc71 100644 --- a/fcron.c +++ b/fcron.c @@ -21,11 +21,11 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcron.c,v 1.35 2000-12-14 18:09:43 thib Exp $ */ + /* $Id: fcron.c,v 1.36 2000-12-30 12:55:06 thib Exp $ */ #include "fcron.h" -char rcs_info[] = "$Id: fcron.c,v 1.35 2000-12-14 18:09:43 thib Exp $"; +char rcs_info[] = "$Id: fcron.c,v 1.36 2000-12-30 12:55:06 thib Exp $"; void main_loop(void); void check_signal(void); @@ -263,7 +263,7 @@ parseopt(int argc, char *argv[]) if (optind < argc) { for (i = optind; i<=argc; i++) - error("Unknown argument '%s'", argv[i]); + error("Unknown argument \"%s\"", argv[i]); usage(); } @@ -423,7 +423,7 @@ main(int argc, char **argv) struct passwd *pass; if ( ! (pass = getpwnam(USERNAME)) ) - die("user '%s' is not in passwd file. Aborting.", USERNAME); + die("user \"%s\" is not in passwd file. Aborting.", USERNAME); if (setregid(pass->pw_gid, 0) != 0 ) die_e("Could not set gid to " GROUPNAME); if (setreuid(pass->pw_uid, 0) != 0 ) diff --git a/fcrontab.c b/fcrontab.c index 9bbf4fc..7d806dc 100644 --- a/fcrontab.c +++ b/fcrontab.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcrontab.c,v 1.26 2000-12-23 20:12:05 thib Exp $ */ + /* $Id: fcrontab.c,v 1.27 2000-12-30 12:54:19 thib Exp $ */ /* * The goal of this program is simple : giving a user interface to fcron @@ -42,7 +42,7 @@ #include "fcrontab.h" -char rcs_info[] = "$Id: fcrontab.c,v 1.26 2000-12-23 20:12:05 thib Exp $"; +char rcs_info[] = "$Id: fcrontab.c,v 1.27 2000-12-30 12:54:19 thib Exp $"; void info(void); void usage(void); @@ -371,7 +371,7 @@ int make_file(char *file) { - explain("installing file '%s' for user %s", file, user); + explain("installing file %s for user %s", file, user); /* read file and create a list in memory */ switch ( read_file(file, user) ) { @@ -411,7 +411,7 @@ list_file(char *file) return ; } else - die_e("User %s could not read file '%s'", user, file); + die_e("User %s could not read file \"%s\"", user, file); } else { @@ -490,7 +490,7 @@ edit_file(char *buf) if ( stat(tmp, &st) == 0 ) mtime = st.st_mtime; else { - error_e("could not stat '%s'", buf); + error_e("could not stat \"%s\"", buf); goto exiterr; } @@ -521,7 +521,7 @@ edit_file(char *buf) } #endif execlp(editor, editor, tmp, NULL); - error_e("Error while running '%s'", editor); + error_e("Error while running \"%s\"", editor); goto exiterr; case -1: @@ -616,7 +616,7 @@ install_stdin(void) sprintf(tmp, "/tmp/fcrontab.%d", getpid()); if( (tmp_file = fopen(tmp, "w")) == NULL ) - die_e("Could not open '%s'", tmp); + die_e("Could not open \"%s\"", tmp); while ( (c = getc(stdin)) != EOF ) putc(c, tmp_file); @@ -651,7 +651,7 @@ reinstall(char *buf) buf); } else - fprintf(stderr, "Could not open '%s': %s\n", buf, + fprintf(stderr, "Could not open \"%s\": %s\n", buf, strerror(errno)); exit (EXIT_ERR); @@ -765,7 +765,7 @@ parseopt(int argc, char *argv[]) if ( user == NULL ) { /* get user's name using getpwuid() */ if ( ! (pass = getpwuid(uid)) ) - die("user '%s' is not in passwd file. Aborting.", USERNAME); + die("user \"%s\" is not in passwd file. Aborting.", USERNAME); /* we need to strdup2 the value given by getpwuid() because we free * file->cf_user in delete_file */ user = strdup2(pass->pw_name); @@ -774,13 +774,13 @@ parseopt(int argc, char *argv[]) } else { if ( ! (pass = getpwnam(user)) ) - die("user '%s' is not in passwd file. Aborting.", user); + die("user \"%s\" is not in passwd file. Aborting.", user); asuid = pass->pw_uid; asgid = pass->pw_gid; } if ( ! is_allowed(user) ) { - die("User '%s' is not allowed to use %s. Aborting.", + die("User \"%s\" is not allowed to use %s. Aborting.", user, prog_name); } @@ -808,7 +808,7 @@ main(int argc, char **argv) { struct passwd *pass; if ( ! (pass = getpwnam(USERNAME)) ) - die("user '%s' is not in passwd file. Aborting.", USERNAME); + die("user \"%s\" is not in passwd file. Aborting.", USERNAME); fcrontab_uid = pass->pw_uid; fcrontab_gid = pass->pw_gid; diff --git a/fileconf.c b/fileconf.c index 84c7f7f..e7f8c14 100644 --- a/fileconf.c +++ b/fileconf.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fileconf.c,v 1.31 2000-12-23 20:16:10 thib Exp $ */ + /* $Id: fileconf.c,v 1.32 2000-12-30 12:54:55 thib Exp $ */ #include "fcrontab.h" @@ -169,9 +169,9 @@ read_file(char *filename, char *user) /* check if user is allowed to read file */ /* create a temp file with user's permissions */ if ( access(file_name, R_OK) != 0 ) - die_e("User %s can't read file '%s'", user, file_name); + die_e("User %s can't read file \"%s\"", user, file_name); else if ( (file = fopen(file_name, "r")) == NULL ) { - fprintf(stderr, "Could not open '%s': %s\n", file_name, + fprintf(stderr, "Could not open \"%s\": %s\n", file_name, strerror(errno)); return ERR; } @@ -229,7 +229,7 @@ read_file(char *filename, char *user) case '!': ptr = read_opt(ptr, &default_line); if ( ptr != NULL && *ptr != '\0' ) { - fprintf(stderr, "%s:%d: Syntax error: string '%s' ignored\n", + fprintf(stderr, "%s:%d: Syntax error: string \"%s\" ignored\n", file_name, line, ptr); need_correction = 1; } @@ -327,7 +327,7 @@ read_env(char *ptr, CF *cf) else { struct passwd *pass = NULL; if ( (pass = getpwnam(val)) == 0 ) { - fprintf(stderr, "%s:%d:MAILTO: '%s' is not in passwd :" + fprintf(stderr, "%s:%d:MAILTO: \"%s\" is not in passwd :" " ignored\n", file_name, line, val); need_correction = 1; } else { @@ -372,7 +372,7 @@ get_runas(char *ptr, uid_t *uid) name[i++] = *ptr++; if ((pas = getpwnam(name)) == NULL) { - fprintf(stderr, "runas: '%s' is not in passwd file : ignored", name); + fprintf(stderr, "runas: \"%s\" is not in passwd file : ignored", name); need_correction = 1; return NULL; } @@ -457,7 +457,7 @@ read_opt(char *ptr, CL *cl) #define Handle_err \ { \ - fprintf(stderr, "%s:%d: Argument(s) for option '%s' not valid: " \ + fprintf(stderr, "%s:%d: Argument(s) for option \"%s\" not valid: " \ "skipping end of line.\n", file_name, line, opt_name); \ need_correction = 1; \ return NULL; \ @@ -489,7 +489,7 @@ read_opt(char *ptr, CL *cl) else set_serial(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if (strcmp(opt_name, "serialonce") == 0 ) { @@ -500,7 +500,7 @@ read_opt(char *ptr, CL *cl) else clear_serial_sev(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if (strcmp(opt_name, "lavgonce") == 0 ) { @@ -511,7 +511,7 @@ read_opt(char *ptr, CL *cl) else clear_lavg_sev(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if (strcmp(opt_name, "exesev") == 0 ) { @@ -522,7 +522,7 @@ read_opt(char *ptr, CL *cl) else set_exe_sev(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if(strcmp(opt_name, "b")==0 || strcmp(opt_name, "bootrun")==0){ @@ -533,7 +533,7 @@ read_opt(char *ptr, CL *cl) else set_bootrun(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if( strcmp(opt_name, "reset")==0 ) { @@ -545,14 +545,14 @@ read_opt(char *ptr, CL *cl) cl->cl_mailto = uid; } if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if(strcmp(opt_name, "f") == 0 || strcmp(opt_name, "first") == 0){ if( ! in_brackets || (ptr=get_time(ptr, &(cl->cl_nextexe)))==NULL) Handle_err; if (debug_opt) - fprintf(stderr, " Opt : '%s' %ld\n",opt_name,cl->cl_nextexe); + fprintf(stderr, " Opt : \"%s\" %ld\n",opt_name,cl->cl_nextexe); } else if(strcmp(opt_name, "r")==0 || strcmp(opt_name, "runfreq")==0) { @@ -564,7 +564,7 @@ read_opt(char *ptr, CL *cl) Handle_err; cl->cl_runfreq = i; if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } /* options to run once per interval : @@ -572,25 +572,25 @@ read_opt(char *ptr, CL *cl) else if (strcmp(opt_name, "mins") == 0) { /* nothing to do */ if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "hours") == 0) { set_freq_mins(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "days") == 0) { set_freq_mins(cl->cl_option); set_freq_hrs(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "mons") == 0) { set_freq_mins(cl->cl_option); set_freq_hrs(cl->cl_option); set_freq_days(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "dow") == 0) { set_freq_mins(cl->cl_option); @@ -598,7 +598,7 @@ read_opt(char *ptr, CL *cl) set_freq_days(cl->cl_option); set_freq_mons(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } /* run once an element of the selected field @@ -607,25 +607,25 @@ read_opt(char *ptr, CL *cl) set_freq_hrs(cl->cl_option); set_freq_periodically(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "daily") == 0) { set_freq_days(cl->cl_option); set_freq_periodically(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "monthly") == 0) { set_freq_mons(cl->cl_option); set_freq_periodically(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "weekly") == 0) { set_freq_dow(cl->cl_option); set_freq_periodically(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } /* run once an element of the selected field @@ -636,7 +636,7 @@ read_opt(char *ptr, CL *cl) set_freq_periodically(cl->cl_option); set_freq_mid(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "middaily") == 0 || strcmp(opt_name, "nightly") == 0) { @@ -644,21 +644,21 @@ read_opt(char *ptr, CL *cl) set_freq_periodically(cl->cl_option); set_freq_mid(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "midmonthly") == 0) { set_freq_mons(cl->cl_option); set_freq_periodically(cl->cl_option); set_freq_mid(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if (strcmp(opt_name, "midweekly") == 0) { set_freq_dow(cl->cl_option); set_freq_periodically(cl->cl_option); set_freq_mid(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s'\n", opt_name); + fprintf(stderr, " Opt : \"%s\"\n", opt_name); } else if ( strcmp(opt_name, "lavg") == 0 ) { @@ -735,7 +735,7 @@ read_opt(char *ptr, CL *cl) else set_land(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if( strcmp(opt_name, "lavgor") == 0 ) { @@ -746,14 +746,14 @@ read_opt(char *ptr, CL *cl) else set_lor(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if(strcmp(opt_name, "u") == 0 || strcmp(opt_name, "until") == 0){ if( ! in_brackets || (ptr=get_time(ptr, &(cl->cl_until)))==NULL) Handle_err; if (debug_opt) - fprintf(stderr, " Opt : '%s' %ld\n",opt_name,cl->cl_until); + fprintf(stderr, " Opt : \"%s\" %ld\n",opt_name,cl->cl_until); } else if(strcmp(opt_name, "m")==0 || strcmp(opt_name, "mail")==0){ @@ -764,7 +764,7 @@ read_opt(char *ptr, CL *cl) else set_mail(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if( strcmp(opt_name, "forcemail") == 0 ) { @@ -775,7 +775,7 @@ read_opt(char *ptr, CL *cl) else set_mailzerolength(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if( strcmp(opt_name, "mailto") == 0) { @@ -793,7 +793,7 @@ read_opt(char *ptr, CL *cl) clear_mail(cl->cl_option); else { if ( (pass = getpwnam(buf)) == NULL ) { - fprintf(stderr, "%s:%d:mailto: '%s' is not in passwd :" + fprintf(stderr, "%s:%d:mailto: \"%s\" is not in passwd :" " ignored\n", file_name, line, buf); need_correction = 1; } else { @@ -802,7 +802,7 @@ read_opt(char *ptr, CL *cl) } } if (debug_opt) - fprintf(stderr, " Opt : '%s' '%s'\n", opt_name, buf); + fprintf(stderr, " Opt : \"%s\" \"%s\"\n", opt_name, buf); } else if( strcmp(opt_name, "dayand") == 0 ) { @@ -813,7 +813,7 @@ read_opt(char *ptr, CL *cl) else set_dayand(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if( strcmp(opt_name, "dayor") == 0 ) { @@ -824,7 +824,7 @@ read_opt(char *ptr, CL *cl) else set_dayor(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if(strcmp(opt_name, "n") == 0 || strcmp(opt_name, "nice") == 0) { @@ -832,7 +832,7 @@ read_opt(char *ptr, CL *cl) Handle_err; cl->cl_nice = (char)i; if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, i); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, i); } else if(strcmp(opt_name, "runas") == 0) { @@ -852,12 +852,12 @@ read_opt(char *ptr, CL *cl) cl->cl_runas = uid; set_runas(cl->cl_option); if (debug_opt) - fprintf(stderr, " Opt : '%s' %d\n", opt_name, uid); + fprintf(stderr, " Opt : \"%s\" %d\n", opt_name, uid); } } else { - fprintf(stderr, "%s:%d: Option '%s' unknown: " + fprintf(stderr, "%s:%d: Option \"%s\" unknown: " "skipping option.\n", file_name, line, opt_name); need_correction = 1; } @@ -1001,7 +1001,7 @@ read_freq(char *ptr, CF *cf) cf->cf_line_base = cl; if ( debug_opt ) - fprintf(stderr, " Cmd '%s', timefreq %ld, first %ld\n", + fprintf(stderr, " Cmd \"%s\", timefreq %ld, first %ld\n", cl->cl_shell, cl->cl_timefreq, cl->cl_nextexe); return; @@ -1095,7 +1095,7 @@ read_arys(char *ptr, CF *cf) cf->cf_line_base = cl; if ( debug_opt ) - fprintf(stderr, " Cmd '%s'\n", cl->cl_shell); + fprintf(stderr, " Cmd \"%s\"\n", cl->cl_shell); return; exiterr: @@ -1221,7 +1221,7 @@ read_period(char *ptr, CF *cf) cf->cf_line_base = cl; if ( debug_opt ) - fprintf(stderr, " Cmd '%s'\n", cl->cl_shell); + fprintf(stderr, " Cmd \"%s\"\n", cl->cl_shell); return; exiterr: diff --git a/job.c b/job.c index a2fd542..e0075e8 100644 --- a/job.c +++ b/job.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: job.c,v 1.26 2000-12-04 20:18:27 thib Exp $ */ + /* $Id: job.c,v 1.27 2000-12-30 12:55:25 thib Exp $ */ #include "fcron.h" @@ -120,7 +120,7 @@ run_job(struct exe *exeent) /* prepare the job execution */ switch ( pid = fork() ) { case -1: - error_e("Fork error : could not exec '%s'", line->cl_shell); + error_e("Fork error : could not exec \"%s\"", line->cl_shell); break; case 0: @@ -189,19 +189,19 @@ run_job(struct exe *exeent) if ( (home = getenv("HOME")) != NULL ) if (chdir(home) != 0) { - error_e("Could not chdir to HOME dir '%s'", home); + error_e("Could not chdir to HOME dir \"%s\"", home); if (chdir("/") < 0) - die_e("Could not chdir to HOME dir '/'"); + die_e("Could not chdir to HOME dir /"); } if ( (shell = getenv("SHELL")) == NULL ) shell = SHELL; else if ( access(shell, X_OK) != 0 ) { if (errno == ENOENT) - error("shell '%s' : no file or directory. SHELL set to " SHELL, - shell); + error("shell \"%s\" : no file or directory. SHELL set to " + SHELL, shell); else - error_e("shell '%s' not valid : SHELL set to " SHELL, shell); + error_e("shell \"%s\" not valid : SHELL set to " SHELL, shell); shell = SHELL; } @@ -209,7 +209,7 @@ run_job(struct exe *exeent) /* now, run the job */ switch ( fork() ) { case -1: - error_e("Fork error : could not exec '%s'", line->cl_shell); + error_e("Fork error : could not exec \"%s\"", line->cl_shell); break; case 0: @@ -218,14 +218,14 @@ run_job(struct exe *exeent) #ifdef CHECKJOBS /* this will force to mail a message containing at least the exact * and complete command executed for each execution of all jobs */ - debug("Execing '%s -c %s'", shell, line->cl_shell); + debug("Execing \"%s -c %s\"", shell, line->cl_shell); #endif /* CHECKJOBS */ execl(shell, shell, "-c", line->cl_shell, NULL); /* execl returns only on error */ - error_e("Can't find '%s'. Trying a execlp(\"sh\", ...)", shell); + error_e("Can't find \"%s\". Trying a execlp(\"sh\", ...)", shell); execlp("sh", "sh", "-c", line->cl_shell, NULL); - die_e("execl() '%s -c %s' error", shell, line->cl_shell); + die_e("execl() \"%s -c %s\" error", shell, line->cl_shell); /* execution never gets here */ @@ -315,7 +315,7 @@ launch_mailer(CL *line, int mailfd) /* run sendmail with mail file as standard input */ execl(SENDMAIL, SENDMAIL, SENDMAIL_ARGS, pass->pw_name, NULL); - error_e("Can't find '"SENDMAIL"'. Trying a execlp(\"sendmail\")"); + error_e("Can't find \""SENDMAIL"\". Trying a execlp(\"sendmail\")"); execlp("sendmail", "sendmail", SENDMAIL_ARGS, pass->pw_name, NULL); die_e("Can't exec " SENDMAIL); -- 2.40.0