From 993d678ed997b4ee11d493b0e87aefe3e3a7a0a3 Mon Sep 17 00:00:00 2001 From: Vit Rosin Date: Wed, 31 Mar 2010 13:28:06 +0400 Subject: [PATCH] Use EXIT_FAILURE symbolic name as return code. Signed-off-by: Andrew Borodin --- lib/tty/key.c | 2 +- lib/tty/tty-slang.c | 4 ++-- lib/vfs/mc-vfs/mcserv.c | 4 ++-- lib/vfs/mc-vfs/utilvfs.c | 2 +- src/main.c | 6 +++--- src/subshell.c | 12 ++++++------ src/widget.c | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/tty/key.c b/lib/tty/key.c index b1064a3c6..8e9de6ffd 100644 --- a/lib/tty/key.c +++ b/lib/tty/key.c @@ -1576,7 +1576,7 @@ get_key_code (int no_delay) if (this == NULL) { /* Shouldn't happen */ fputs ("Internal error\n", stderr); - exit (1); + exit (EXIT_FAILURE); } goto nodelay_try_again; } diff --git a/lib/tty/tty-slang.c b/lib/tty/tty-slang.c index 73581e282..1ec971b6f 100644 --- a/lib/tty/tty-slang.c +++ b/lib/tty/tty-slang.c @@ -254,7 +254,7 @@ tty_init (gboolean slow, gboolean ugly_lines) fprintf (stderr, _("Screen size %dx%d is not supported.\n" "Check the TERM environment variable.\n"), COLS, LINES); - exit (1); + exit (EXIT_FAILURE); } tcgetattr (fileno (stdin), &boot_mode); @@ -394,7 +394,7 @@ tty_lowlevel_getch (void) fprintf (stderr, "SLang_getkey returned SLANG_GETKEY_ERROR\n" "Assuming EOF on stdin and exiting\n"); - exit (1); + exit (EXIT_FAILURE); } return c; diff --git a/lib/vfs/mc-vfs/mcserv.c b/lib/vfs/mc-vfs/mcserv.c index fd707f8a6..0c7b06458 100644 --- a/lib/vfs/mc-vfs/mcserv.c +++ b/lib/vfs/mc-vfs/mcserv.c @@ -1309,7 +1309,7 @@ register_port (int port, int abort_if_fail) else { fprintf (stderr, "Cannot register service with portmapper\n"); if (abort_if_fail) - exit (1); + exit (EXIT_FAILURE); } #else (void) port; @@ -1403,5 +1403,5 @@ void vfs_die (const char *m) { fputs (m, stderr); - exit (1); + exit (EXIT_FAILURE); } diff --git a/lib/vfs/mc-vfs/utilvfs.c b/lib/vfs/mc-vfs/utilvfs.c index 5df51948d..3de6a17ef 100644 --- a/lib/vfs/mc-vfs/utilvfs.c +++ b/lib/vfs/mc-vfs/utilvfs.c @@ -819,7 +819,7 @@ void vfs_die (const char *m) { message (D_ERROR, _("Internal error:"), "%s", m); - exit (1); + exit (EXIT_FAILURE); } char * diff --git a/src/main.c b/src/main.c index 3fcf84d7a..ba24bdb95 100644 --- a/src/main.c +++ b/src/main.c @@ -1452,7 +1452,7 @@ init_xterm_support (void) if (!termvalue || !(*termvalue)) { fputs (_("The TERM environment variable is unset!\n"), stderr); - exit (1); + exit (EXIT_FAILURE); } /* Check mouse capabilities */ @@ -2225,7 +2225,7 @@ mc_main__setup_by_args (int argc, char *argv[]) else { fputs ("No arguments given to the viewer\n", stderr); - exit (1); + exit (EXIT_FAILURE); } mc_run_mode = MC_RUN_VIEWER; #ifdef USE_DIFF_VIEW @@ -2235,7 +2235,7 @@ mc_main__setup_by_args (int argc, char *argv[]) if (argc < 3) { fputs ("There 2 files are required to diffviewer\n", stderr); - exit (1); + exit (EXIT_FAILURE); } else if (tmp != NULL) { diff --git a/src/subshell.c b/src/subshell.c index bb84c6567..d0f46dcc5 100644 --- a/src/subshell.c +++ b/src/subshell.c @@ -494,7 +494,7 @@ init_subshell (void) fprintf (stderr, "Cannot spawn the subshell process: %s\r\n", unix_error_string (errno)); /* We exit here because, if the process table is full, the */ /* other method of running user commands won't work either */ - exit (1); + exit (EXIT_FAILURE); } if (subshell_pid == 0) @@ -651,7 +651,7 @@ read_subshell_prompt (void) else { fprintf (stderr, "select (FD_SETSIZE, &tmp...): %s\r\n", unix_error_string (errno)); - exit (1); + exit (EXIT_FAILURE); } } @@ -1033,7 +1033,7 @@ feed_subshell (int how, int fail_on_error) tcsetattr (STDOUT_FILENO, TCSANOW, &shell_mode); fprintf (stderr, "select (FD_SETSIZE, &read_set...): %s\r\n", unix_error_string (errno)); - exit (1); + exit (EXIT_FAILURE); } if (FD_ISSET (subshell_pty, &read_set)) @@ -1054,7 +1054,7 @@ feed_subshell (int how, int fail_on_error) { tcsetattr (STDOUT_FILENO, TCSANOW, &shell_mode); fprintf (stderr, "read (subshell_pty...): %s\r\n", unix_error_string (errno)); - exit (1); + exit (EXIT_FAILURE); } if (how == VISIBLY) @@ -1071,7 +1071,7 @@ feed_subshell (int how, int fail_on_error) tcsetattr (STDOUT_FILENO, TCSANOW, &shell_mode); fprintf (stderr, "read (subshell_pipe[READ]...): %s\r\n", unix_error_string (errno)); - exit (1); + exit (EXIT_FAILURE); } subshell_cwd[bytes - 1] = 0; /* Squash the final '\n' */ @@ -1095,7 +1095,7 @@ feed_subshell (int how, int fail_on_error) tcsetattr (STDOUT_FILENO, TCSANOW, &shell_mode); fprintf (stderr, "read (STDIN_FILENO, pty_buffer...): %s\r\n", unix_error_string (errno)); - exit (1); + exit (EXIT_FAILURE); } for (i = 0; i < bytes; ++i) diff --git a/src/widget.c b/src/widget.c index fb47afd0b..0b6497330 100644 --- a/src/widget.c +++ b/src/widget.c @@ -1422,7 +1422,7 @@ input_destroy (WInput * in) if (in == NULL) { fprintf (stderr, "Internal error: null Input *\n"); - exit (1); + exit (EXIT_FAILURE); } new_input (in);