summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2014-06-17 15:20:09 +0200
committerJiří Klimeš <jklimes@redhat.com>2014-06-24 10:52:16 +0200
commitc0822f6054999b7ca196a234d8a1e7bf4cec6f1d (patch)
tree12e1f707bfacbbe6c002b2dfc32230fb78423808
parentdbf2d0855966a90abaf38f4d6ec4678502bd84b8 (diff)
downloadNetworkManager-c0822f6054999b7ca196a234d8a1e7bf4cec6f1d.tar.gz
cli: append NL to error messages and also print the signal name
-rw-r--r--cli/src/nmcli.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/cli/src/nmcli.c b/cli/src/nmcli.c
index 5aa9aab03f..182afe11d9 100644
--- a/cli/src/nmcli.c
+++ b/cli/src/nmcli.c
@@ -331,14 +331,16 @@ signal_handling_thread (void *arg) {
} else {
/* We can quit nmcli */
nmc_cleanup_readline ();
- printf (_("\nError: nmcli terminated by signal %d."), signo);
+ printf (_("\nError: nmcli terminated by signal %s (%d)\n"),
+ strsignal (signo), signo);
exit (1);
}
break;
case SIGQUIT:
case SIGTERM:
nmc_cleanup_readline ();
- printf (_("\nError: nmcli terminated by signal %d."), signo);
+ printf (_("\nError: nmcli terminated by signal %s (%d)\n"),
+ strsignal (signo), signo);
exit (1);
break;
default:
@@ -368,14 +370,14 @@ setup_signals (void)
/* Block all signals of interest. */
status = pthread_sigmask (SIG_BLOCK, &signal_set, NULL);
if (status != 0) {
- fprintf (stderr, _("Failed to set signal mask: %d"), status);
+ fprintf (stderr, _("Failed to set signal mask: %d\n"), status);
return FALSE;
}
- /* Create the signal handling thread. */
+ /* Create the signal handling thread. */
status = pthread_create (&signal_thread_id, NULL, signal_handling_thread, NULL);
if (status != 0) {
- fprintf (stderr, _("Failed to create signal handling thread: %d"), status);
+ fprintf (stderr, _("Failed to create signal handling thread: %d\n"), status);
return FALSE;
}