Use PROGNAME_WIFIBROWSER for wifibrowser(1)

This commit is contained in:
Pierre Pronchery 2018-01-22 03:05:51 +01:00
parent 3a145c35c6
commit 6faafd4517

View File

@ -29,17 +29,17 @@
#define _(string) gettext(string) #define _(string) gettext(string)
/* constants */ /* constants */
#ifndef PROGNAME #ifndef PROGNAME_WIFIBROWSER
# define PROGNAME "wifibrowser" # define PROGNAME_WIFIBROWSER "wifibrowser"
#endif #endif
#ifndef PREFIX #ifndef PREFIX
# define PREFIX "/usr/local" # define PREFIX "/usr/local"
#endif #endif
#ifndef DATADIR #ifndef DATADIR
# define DATADIR PREFIX "/share" # define DATADIR PREFIX "/share"
#endif #endif
#ifndef LOCALEDIR #ifndef LOCALEDIR
# define LOCALEDIR DATADIR "/locale" # define LOCALEDIR DATADIR "/locale"
#endif #endif
@ -100,14 +100,14 @@ static int _wifibrowser(char const * configfile, char const * interface)
{ {
if(configfile != NULL if(configfile != NULL
&& config_load(panel.config, configfile) != 0) && config_load(panel.config, configfile) != 0)
error_print(PROGNAME); error_print(PROGNAME_WIFIBROWSER);
if(interface != NULL if(interface != NULL
&& config_set(panel.config, "wpa_supplicant", && config_set(panel.config, "wpa_supplicant",
"interface", interface) != 0) "interface", interface) != 0)
error_print(PROGNAME); error_print(PROGNAME_WIFIBROWSER);
} }
else else
error_print(PROGNAME); error_print(PROGNAME_WIFIBROWSER);
/* FIXME load the configuration */ /* FIXME load the configuration */
memset(&helper, 0, sizeof(helper)); memset(&helper, 0, sizeof(helper));
helper.panel = &panel; helper.panel = &panel;
@ -190,7 +190,7 @@ static int _error(Panel * panel, char const * message, int ret)
{ {
(void) panel; (void) panel;
fputs(PROGNAME ": ", stderr); fputs(PROGNAME_WIFIBROWSER ": ", stderr);
perror(message); perror(message);
return ret; return ret;
} }
@ -201,7 +201,7 @@ static int _usage(void)
{ {
fprintf(stderr, _("Usage: %s [-c filename][-i interface]\n" fprintf(stderr, _("Usage: %s [-c filename][-i interface]\n"
" -c Path to a configuration file\n" " -c Path to a configuration file\n"
" -i Network interface to connect to\n"), PROGNAME); " -i Network interface to connect to\n"), PROGNAME_WIFIBROWSER);
return 1; return 1;
} }