aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-11-10 07:06:03 +0100
committerPřemysl Janouch <p@janouch.name>2018-11-10 07:06:03 +0100
commit6e67469e3ff8d82ac28a75bb0d9d4185ebfc7900 (patch)
tree5ab5b81397909c6985a13c9041a6d7c9618bac60
parent7143225fc582084630693ad6f9e455b3206f4fff (diff)
downloaddesktop-tools-6e67469e3ff8d82ac28a75bb0d9d4185ebfc7900.tar.gz
desktop-tools-6e67469e3ff8d82ac28a75bb0d9d4185ebfc7900.tar.xz
desktop-tools-6e67469e3ff8d82ac28a75bb0d9d4185ebfc7900.zip
paswitch: actually exit the program on error
-rw-r--r--paswitch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/paswitch.c b/paswitch.c
index e8bb563..13bfe47 100644
--- a/paswitch.c
+++ b/paswitch.c
@@ -1039,16 +1039,16 @@ main (int argc, char *argv[])
opt_handler_free (&oh);
if (!isatty (STDIN_FILENO))
- print_fatal ("input is not a terminal");
+ exit_fatal ("input is not a terminal");
if (!isatty (STDOUT_FILENO))
- print_fatal ("output is not a terminal");
+ exit_fatal ("output is not a terminal");
setlocale (LC_CTYPE, "");
// PulseAudio uses UTF-8, let's avoid encoding conversions
if (strcasecmp (nl_langinfo (CODESET), "UTF-8"))
- print_fatal ("UTF-8 encoding required");
+ exit_fatal ("UTF-8 encoding required");
if (setvbuf (stdout, NULL, _IOLBF, 0) || !tty_start ())
- print_fatal ("terminal initialization failed");
+ exit_fatal ("terminal initialization failed");
// TODO: we will need a logging function aware of our rendering
g_log_message_real = log_message_custom;