summaryrefslogtreecommitdiffstats
path: root/netlink-notify.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-10-01 13:09:33 +0200
committerGravatar Christian Hesse <mail@eworm.de>2014-10-01 13:09:33 +0200
commit2ae554021fb6a7c3e8486dc0fa2c48a2e8adf0a0 (patch)
tree2f14752a9d235ab0fb48ebded6ea9ca279a24287 /netlink-notify.c
parent984cec083228d75b96c65a7e81ec6688a5ee4d0c (diff)
downloadnetlink-notify-2ae554021fb6a7c3e8486dc0fa2c48a2e8adf0a0.tar.gz
netlink-notify-2ae554021fb6a7c3e8486dc0fa2c48a2e8adf0a0.tar.zst
use same output format everywhere
Diffstat (limited to 'netlink-notify.c')
-rw-r--r--netlink-notify.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/netlink-notify.c b/netlink-notify.c
index 497d33e..6570323 100644
--- a/netlink-notify.c
+++ b/netlink-notify.c
@@ -436,7 +436,7 @@ out:
/*** received_signal ***/
void received_signal(int signal) {
if (verbose > 0)
- printf("Received signal: %d\n", signal);
+ printf("%s: Received signal: %d\n", program, signal);
doexit++;
}
@@ -461,15 +461,15 @@ int main (int argc, char **argv) {
}
}
- printf ("%s: %s v%s (compiled: " __DATE__ ", " __TIME__ ")\n", argv[0], PROGNAME, VERSION);
+ printf ("%s: %s v%s (compiled: " __DATE__ ", " __TIME__ ")\n", program, PROGNAME, VERSION);
if ((nls = open_netlink()) < 0) {
- fprintf (stderr, "%s: Error opening netlink socket!", argv[0]);
+ fprintf (stderr, "%s: Error opening netlink socket!\n", program);
goto out40;
}
if (!notify_init (PROGNAME)) {
- fprintf (stderr, "%s: Can't create notify.\n", argv[0]);
+ fprintf (stderr, "%s: Can't create notify.\n", program);
goto out30;
}
@@ -478,18 +478,18 @@ int main (int argc, char **argv) {
while (doexit == 0) {
if (read_event(nls) != EXIT_SUCCESS) {
- fprintf(stderr, "read_event returned error.\n");
+ fprintf(stderr, "%s: read_event returned error.\n", program);
goto out10;
}
}
if (verbose > 0)
- printf("Exiting...\n");
+ printf("%s: Exiting...\n", program);
for(; maxinterface > 0; maxinterface--) {
if (verbose > 0)
- printf("Freeing interface %d (%s).\n", maxinterface,
- ifs[maxinterface].name);
+ printf("%s: Freeing interface %d: %s\n", program,
+ maxinterface, ifs[maxinterface].name);
free_addresses(ifs[maxinterface].addresses_seen);
if (ifs[maxinterface].notification != NULL)
@@ -507,7 +507,7 @@ out10:
out30:
if (close(nls) < 0)
- fprintf(stderr, "Failed to close socket.\n");
+ fprintf(stderr, "%s: Failed to close socket.\n", program);
out40:
return rc;