paswitch: actually exit the program on error

This commit is contained in:
Přemysl Eric Janouch 2018-11-10 07:06:03 +01:00
parent 7143225fc5
commit 6e67469e3f
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 4 additions and 4 deletions

View File

@ -1039,16 +1039,16 @@ main (int argc, char *argv[])
opt_handler_free (&oh); opt_handler_free (&oh);
if (!isatty (STDIN_FILENO)) if (!isatty (STDIN_FILENO))
print_fatal ("input is not a terminal"); exit_fatal ("input is not a terminal");
if (!isatty (STDOUT_FILENO)) if (!isatty (STDOUT_FILENO))
print_fatal ("output is not a terminal"); exit_fatal ("output is not a terminal");
setlocale (LC_CTYPE, ""); setlocale (LC_CTYPE, "");
// PulseAudio uses UTF-8, let's avoid encoding conversions // PulseAudio uses UTF-8, let's avoid encoding conversions
if (strcasecmp (nl_langinfo (CODESET), "UTF-8")) 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 ()) 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 // TODO: we will need a logging function aware of our rendering
g_log_message_real = log_message_custom; g_log_message_real = log_message_custom;