]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
(run_shell): Declare with noreturn attribute.
authorJim Meyering <jim@meyering.net>
Sun, 22 Aug 1999 10:53:13 +0000 (10:53 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 22 Aug 1999 10:53:13 +0000 (10:53 +0000)
Use an explicit exit(1) rather than doing that through error.

login-utils/su.c

index 0f5efd22d803bb2ee40e949dda699487f152cc03..1a871f8503d38b92d847864286fd480ed55c3b7e 100644 (file)
@@ -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