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

View File

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