aboutsummaryrefslogtreecommitdiffstats
path: root/src/su.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-08-29 00:13:16 +0200
committerJim Meyering <jim@meyering.net>2007-08-29 00:14:23 +0200
commit35755454e45a6cbab4c711353131df483d89a979 (patch)
treed2bb8299b0d0678fadb121db71f8278eea680e82 /src/su.c
parent* src/test.c (usage): Say that [ honors --help and --version, but test does not. (diff)
downloadcoreutils-35755454e45a6cbab4c711353131df483d89a979.tar.gz
coreutils-35755454e45a6cbab4c711353131df483d89a979.zip
Use EXIT_FAILURE, not EXIT_FAIL, now that EXIT_FAILURE is always 1.
* src/system.h (EXIT_FAIL): Remove definition. * src/chroot.c (main): EXIT_FAIL -> EXIT_FAILURE. * src/env.c (main): Likewise. * src/nice.c (main): Likewise. * src/su.c (change_identity, main): Likewise. * src/tty.c (main): Likewise. Suggestion from Eric Blake.
Diffstat (limited to 'src/su.c')
-rw-r--r--src/su.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/su.c b/src/su.c
index 51eed60eb..7778002f8 100644
--- a/src/su.c
+++ b/src/su.c
@@ -299,13 +299,13 @@ change_identity (const struct passwd *pw)
#ifdef HAVE_INITGROUPS
errno = 0;
if (initgroups (pw->pw_name, pw->pw_gid) == -1)
- error (EXIT_FAIL, errno, _("cannot set groups"));
+ error (EXIT_FAILURE, errno, _("cannot set groups"));
endgrent ();
#endif
if (setgid (pw->pw_gid))
- error (EXIT_FAIL, errno, _("cannot set group id"));
+ error (EXIT_FAILURE, errno, _("cannot set group id"));
if (setuid (pw->pw_uid))
- error (EXIT_FAIL, errno, _("cannot set user id"));
+ error (EXIT_FAILURE, errno, _("cannot set user id"));
}
/* Run SHELL, or DEFAULT_SHELL if SHELL is empty.
@@ -419,7 +419,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- initialize_exit_failure (EXIT_FAIL);
+ initialize_exit_failure (EXIT_FAILURE);
atexit (close_stdout);
fast_startup = false;
@@ -456,7 +456,7 @@ main (int argc, char **argv)
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
- usage (EXIT_FAIL);
+ usage (EXIT_FAILURE);
}
}
@@ -471,7 +471,7 @@ main (int argc, char **argv)
pw = getpwnam (new_user);
if (! (pw && pw->pw_name && pw->pw_name[0] && pw->pw_dir && pw->pw_dir[0]
&& pw->pw_passwd))
- error (EXIT_FAIL, 0, _("user %s does not exist"), new_user);
+ error (EXIT_FAILURE, 0, _("user %s does not exist"), new_user);
/* Make a copy of the password information and point pw at the local
copy instead. Otherwise, some systems (e.g. Linux) would clobber
@@ -494,7 +494,7 @@ main (int argc, char **argv)
#ifdef SYSLOG_FAILURE
log_su (pw, false);
#endif
- error (EXIT_FAIL, 0, _("incorrect password"));
+ error (EXIT_FAILURE, 0, _("incorrect password"));
}
#ifdef SYSLOG_SUCCESS
else