summaryrefslogtreecommitdiff
path: root/src/su.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-08-22 10:53:13 +0000
committerJim Meyering <jim@meyering.net>1999-08-22 10:53:13 +0000
commit705cf20084614f16e11b162477f66bcae8450ef8 (patch)
tree298260214400d0a9b69b97c196980de448660e82 /src/su.c
parentfc08f1058a6f273479ab61444a49043a84df9d17 (diff)
downloadcoreutils-705cf20084614f16e11b162477f66bcae8450ef8.tar.xz
(run_shell): Declare with noreturn attribute.
Use an explicit exit(1) rather than doing that through error.
Diffstat (limited to 'src/su.c')
-rw-r--r--src/su.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/su.c b/src/su.c
index 0f5efd22d..1a871f850 100644
--- a/src/su.c
+++ b/src/su.c
@@ -154,6 +154,8 @@ char *xstrdup ();
extern char **environ;
+static void run_shell (const char *, const char *, char **) ATTRIBUTE_NORETURN;
+
/* The name this program was run with. */
char *program_name;
@@ -398,7 +400,8 @@ run_shell (const char *shell, const char *command, char **additional_args)
args[argno++] = *additional_args;
args[argno] = NULL;
execv (shell, (char **) args);
- error (1, errno, _("cannot run %s"), shell);
+ error (0, errno, _("cannot run %s"), shell);
+ exit (1);
}
/* Return 1 if SHELL is a restricted shell (one not returned by