mirror of
https://github.com/MidnightCommander/mc
synced 2025-04-02 13:12:53 +03:00
* cons.handler.c (handle_console): Check the result of ttyname().
This commit is contained in:
parent
75b84a3b47
commit
0c940743b3
@ -1,5 +1,7 @@
|
||||
2001-01-27 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* cons.handler.c (handle_console): Check the result of ttyname().
|
||||
|
||||
* main.c (handle_args): Exit if no arguments are given to mcview.
|
||||
[HAVE_GNOME]: Don't examine argv[0] - it's done separately.
|
||||
|
||||
|
@ -146,10 +146,12 @@ void handle_console (unsigned char action)
|
||||
/* Bind standard error to /dev/null */
|
||||
close (2);
|
||||
open ("/dev/null", O_WRONLY);
|
||||
/* Exec the console save/restore handler */
|
||||
mc_conssaver = concat_dir_and_file (mc_home, "bin/cons.saver");
|
||||
execl (mc_conssaver, "cons.saver", tty_name, NULL);
|
||||
/* Exec failed */
|
||||
if (tty_name) {
|
||||
/* Exec the console save/restore handler */
|
||||
mc_conssaver = concat_dir_and_file (mc_home, "bin/cons.saver");
|
||||
execl (mc_conssaver, "cons.saver", tty_name, NULL);
|
||||
}
|
||||
/* Console is not a tty or execl() failed */
|
||||
console_flag = 0;
|
||||
write (1, &console_flag, 1);
|
||||
close (1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user