Use PROGNAME in tests

This commit is contained in:
Pierre Pronchery 2015-10-04 04:15:46 +02:00
parent 7041166900
commit c43c29eb6e
2 changed files with 12 additions and 4 deletions

View File

@ -22,6 +22,10 @@
#include <dlfcn.h>
#include "Browser/plugin.h"
#ifndef PROGNAME
# define PROGNAME "plugins"
#endif
/* private */
/* prototypes */
@ -90,7 +94,7 @@ static int _plugins(void)
/* dlerror */
static int _dlerror(char const * message, int ret)
{
fputs("plugins: ", stderr);
fputs(PROGNAME ": ", stderr);
fprintf(stderr, "%s: %s\n", message, dlerror());
return ret;
}
@ -99,7 +103,7 @@ static int _dlerror(char const * message, int ret)
/* error */
static int _error(char const * message, char const * error, int ret)
{
fputs("plugins: ", stderr);
fputs(PROGNAME ": ", stderr);
fprintf(stderr, "%s: %s\n", message, error);
return ret;
}
@ -108,7 +112,7 @@ static int _error(char const * message, char const * error, int ret)
/* perror */
static int _perror(char const * message, int ret)
{
fputs("plugins: ", stderr);
fputs(PROGNAME ": ", stderr);
perror(message);
return ret;
}

View File

@ -23,6 +23,10 @@
#include <Desktop/mime.h>
#include "Browser/vfs.h"
#ifndef PROGNAME
# define PROGNAME "vfs"
#endif
/* vfs */
static int _vfs(void)
@ -51,7 +55,7 @@ static int _vfs(void)
/* usage */
static int _usage(void)
{
fputs("Usage: vfs\n", stderr);
fputs("Usage: " PROGNAME "\n", stderr);
return 1;
}