diff --git a/src/scancel/opt.c b/src/scancel/opt.c index a280146175df48029c0f9162753830e8310bf614..f8bd17482021be57402f675e53f7956568f1a860 100644 --- a/src/scancel/opt.c +++ b/src/scancel/opt.c @@ -264,7 +264,6 @@ static void _opt_env() static void _opt_args(int argc, char **argv) { int opt_char; - log_options_t opts = LOG_OPTS_STDERR_ONLY ; int option_index; static struct option long_options[] = { {"help", no_argument, 0, 'H'}, @@ -279,8 +278,6 @@ static void _opt_args(int argc, char **argv) {"version", no_argument, 0, 'V'} }; - log_init("scancel", opts, SYSLOG_FACILITY_DAEMON, NULL); - while((opt_char = getopt_long(argc, argv, "Hin:p:s:t:u:vV", long_options, &option_index)) != -1) { switch (opt_char) { diff --git a/src/scancel/scancel.c b/src/scancel/scancel.c index 4251efc67828ae97423075cc309bfdd0ea10c4d5..c765ab7a57b81edd21b38760940d6af6e199405b 100644 --- a/src/scancel/scancel.c +++ b/src/scancel/scancel.c @@ -46,6 +46,7 @@ #include "src/common/log.h" #include "src/common/slurm_protocol_api.h" +#include "src/common/xstring.h" #include "src/common/xmalloc.h" #include "src/scancel/scancel.h" @@ -66,7 +67,7 @@ main (int argc, char *argv[]) { log_options_t log_opts = LOG_OPTS_STDERR_ONLY ; - log_init ("scancel", log_opts, SYSLOG_FACILITY_DAEMON, NULL); + log_init (xbasename(argv[0]), log_opts, SYSLOG_FACILITY_DAEMON, NULL); initialize_and_process_args(argc, argv); if (opt.verbose) { log_opts.stderr_level += opt.verbose; diff --git a/src/sinfo/opts.c b/src/sinfo/opts.c index 7f150cc7bec73843db7bf37d6b4a4a7b1f1a19b1..6f39f886db6d1e966f3e485f418f102cc9ef0daf 100644 --- a/src/sinfo/opts.c +++ b/src/sinfo/opts.c @@ -59,7 +59,6 @@ extern void parse_command_line(int argc, char *argv[]) { char *env_val = NULL; int opt_char; - log_options_t opts = LOG_OPTS_STDERR_ONLY ; int option_index; static struct option long_options[] = { {"exact", no_argument, 0, 'e'}, @@ -79,8 +78,6 @@ extern void parse_command_line(int argc, char *argv[]) {"version", no_argument, 0, 'V'} }; - log_init("sinfo", opts, SYSLOG_FACILITY_DAEMON, NULL); - while((opt_char = getopt_long(argc, argv, "ehHi:ln:No:p:sS:t:vV", long_options, &option_index)) != -1) { switch (opt_char) { diff --git a/src/sinfo/sinfo.c b/src/sinfo/sinfo.c index 601fa36b1a813c317bef9bdce6197dca06738e28..e6cd76d6f93b6555c8b00b0f2623846fdabbd942 100644 --- a/src/sinfo/sinfo.c +++ b/src/sinfo/sinfo.c @@ -24,6 +24,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ +#include "src/common/xstring.h" #include "src/common/macros.h" #include "src/sinfo/sinfo.h" #include "src/sinfo/print.h" @@ -63,7 +64,7 @@ int main(int argc, char *argv[]) node_info_msg_t *node_msg = NULL; List sinfo_list = NULL; - log_init("sinfo", opts, SYSLOG_FACILITY_DAEMON, NULL); + log_init(xbasename(argv[0]), opts, SYSLOG_FACILITY_DAEMON, NULL); parse_command_line(argc, argv); while (1) { diff --git a/src/squeue/opts.c b/src/squeue/opts.c index 6baf20deb8bbcd2453e9dbf2045426bbc9fa7902..827354bb84fc9eaf6460879ec62324c31fb689c7 100644 --- a/src/squeue/opts.c +++ b/src/squeue/opts.c @@ -62,7 +62,6 @@ parse_command_line( int argc, char* argv[] ) { char *env_val = NULL; int opt_char; - log_options_t opts = LOG_OPTS_STDERR_ONLY ; int option_index; static struct option long_options[] = { {"noheader", no_argument, 0, 'h'}, @@ -81,8 +80,6 @@ parse_command_line( int argc, char* argv[] ) {"version", no_argument, 0, 'V'} }; - log_init("sinfo", opts, SYSLOG_FACILITY_DAEMON, NULL); - while((opt_char = getopt_long(argc, argv, "hHi:j::lo:p:s::S:t:u:vV", long_options, &option_index)) != -1) { switch (opt_char) { diff --git a/src/squeue/squeue.c b/src/squeue/squeue.c index fe7c5e5fdf34d161220dc368da9e5d434ff0afcd..d55b7efa45a673372a0be8e62ad0fd883c9b24fd 100644 --- a/src/squeue/squeue.c +++ b/src/squeue/squeue.c @@ -28,6 +28,7 @@ #include <termcap.h> #include <termios.h> +#include "src/common/xstring.h" #include "src/squeue/squeue.h" /******************** @@ -50,7 +51,7 @@ main (int argc, char *argv[]) { log_options_t opts = LOG_OPTS_STDERR_ONLY ; - log_init(argv[0], opts, SYSLOG_FACILITY_DAEMON, NULL); + log_init(xbasename(argv[0]), opts, SYSLOG_FACILITY_DAEMON, NULL); parse_command_line( argc, argv ); max_line_size = _get_window_width( );