]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[CLEANUP] startup: report only the basename in the usage message
authorWilly Tarreau <w@1wt.eu>
Sat, 10 Sep 2011 17:20:23 +0000 (19:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 10 Sep 2011 17:20:23 +0000 (19:20 +0200)
Don't write the full path to the program, just the program name.

src/haproxy.c

index f783c3d90689a0bdcdc0d43dad98e0f0b1ba3978..0204d06b5214206ed4c70d5419b9d002b627511b 100644 (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 */