[CLEANUP] startup: report only the basename in the usage message

Don't write the full path to the program, just the program name.
This commit is contained in:
Willy Tarreau 2011-09-10 19:20:23 +02:00
parent 45a1251515
commit 3bafcdc07e

View File

@ -352,7 +352,6 @@ void init(int argc, char **argv)
{
int i;
int arg_mode = 0; /* MODE_DEBUG, ... */
char *old_argv = *argv;
char *tmp;
char *cfg_pidfile = NULL;
int err_code = 0;
@ -474,7 +473,7 @@ void init(int argc, char **argv)
while (argc > 0) {
oldpids[nb_oldpids] = atol(*argv);
if (oldpids[nb_oldpids] <= 0)
usage(old_argv);
usage(progname);
argc--; argv++;
nb_oldpids++;
}
@ -483,7 +482,7 @@ void init(int argc, char **argv)
else { /* >=2 args */
argv++; argc--;
if (argc == 0)
usage(old_argv);
usage(progname);
switch (*flag) {
case 'n' : cfg_maxconn = atol(*argv); break;
@ -500,12 +499,12 @@ void init(int argc, char **argv)
LIST_ADDQ(&cfg_cfgfiles, &wl->list);
break;
case 'p' : cfg_pidfile = *argv; break;
default: usage(old_argv);
default: usage(progname);
}
}
}
else
usage(old_argv);
usage(progname);
argv++; argc--;
}
@ -514,7 +513,7 @@ void init(int argc, char **argv)
| MODE_QUIET | MODE_CHECK | MODE_DEBUG));
if (LIST_ISEMPTY(&cfg_cfgfiles))
usage(old_argv);
usage(progname);
have_appsession = 0;
global.maxsock = 10; /* reserve 10 fds ; will be incremented by socket eaters */