summaryrefslogtreecommitdiff
path: root/c-sources
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2018-12-04 10:53:15 +0000
committerWill Thompson <will@willthompson.co.uk>2018-12-07 09:00:47 +0000
commitc80e2fe33664edf9106574658db4eb051aaf782c (patch)
tree9dd6038be2e7dc354f7c22daf974853ed3abd63f /c-sources
parentc882da407f0fdb0e22fad228611c1a35c1cea90a (diff)
bustle-pcap: include newline on startup errors
Diffstat (limited to 'c-sources')
-rw-r--r--c-sources/bustle-pcap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/c-sources/bustle-pcap.c b/c-sources/bustle-pcap.c
index 00e389f..93c6f95 100644
--- a/c-sources/bustle-pcap.c
+++ b/c-sources/bustle-pcap.c
@@ -208,7 +208,7 @@ stopped_cb (
GMainLoop *loop = user_data;
if (!(domain == G_IO_ERROR && code == G_IO_ERROR_CANCELLED))
- fprintf (stderr, "Error: %s %d %s", g_quark_to_string (domain), code, message);
+ g_printerr ("Error while monitoring: %s\n", message);
g_main_loop_quit (loop);
}
@@ -230,7 +230,7 @@ main (
{
GMainLoop *loop;
gchar *filename;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
BustlePcapMonitor *pcap;
parse_arguments (&argc, &argv, &filename);
@@ -238,9 +238,8 @@ main (
pcap = bustle_pcap_monitor_new (bus_type, address, filename, &error);
if (pcap == NULL)
{
- fprintf (stderr, "%s %d %s",
- g_quark_to_string (error->domain), error->code, error->message);
- g_clear_error (&error);
+ g_printerr ("Failed to start monitor: %s\n",
+ error->message);
exit (1);
}