From 25b02ebcc7645c8acd3499a0f0412096e17340bb Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sat, 13 Jun 2015 12:09:49 -0400 Subject: [PATCH] Use PROGNAME --- tests/transport.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/transport.c b/tests/transport.c index 70b5da7..dc40f25 100644 --- a/tests/transport.c +++ b/tests/transport.c @@ -23,6 +23,10 @@ #include #include "App.h" +#ifndef PROGNAME +# define PROGNAME "transport" +#endif + /* private */ /* types */ @@ -73,17 +77,17 @@ static int _transport(char const * protocol, char const * name) /* load the transport plug-in */ if((cwd = getcwd(NULL, 0)) == NULL) - return error_set_print("transport", 2, "%s", strerror(errno)); + return error_set_print(PROGNAME, 2, "%s", strerror(errno)); /* XXX rather ugly but does the trick */ plugin = plugin_new(cwd, "../src", "transport", protocol); free(cwd); if(plugin == NULL) - return error_print("transport"); + return error_print(PROGNAME); transport.ret = 0; if((transport.plugind = plugin_lookup(plugin, "transport")) == NULL) { plugin_delete(plugin); - return error_print("transport"); + return error_print(PROGNAME); } /* initialize the helper */ memset(helper, 0, sizeof(*helper)); @@ -109,7 +113,7 @@ static int _transport(char const * protocol, char const * name) if(transport.server != NULL) transport.plugind->destroy(transport.server); plugin_delete(plugin); - return error_print("transport"); + return error_print(PROGNAME); } transport.message = appmessage_new_callv("hello", -1); tv.tv_sec = 1; @@ -121,11 +125,11 @@ static int _transport(char const * protocol, char const * name) _transport_callback_timeout, &transport) != 0 || event_loop(helper->event) != 0) { - error_print("transport"); + error_print(PROGNAME); transport.ret = -1; } else if(transport.ret != 0) - error_print("transport"); + error_print(PROGNAME); appmessage_delete(transport.message); transport.plugind->destroy(transport.client); transport.plugind->destroy(transport.server);