* src/userdel.c, src/lastlog.c, src/gpasswd.c, src/newusers.c,

src/chpasswd.c, src/groupmems.c, src/usermod.c, src/chgpasswd.c,
	src/vipw.c, src/su.c, src/useradd.c, src/groupmod.c, src/passwd.c,
	src/groupadd.c, src/chage.c, src/faillog.c, src/chsh.c: Use
	booleans for tests.
	* src/userdel.c, src/gpasswd.c, src/groupmems.c, src/usermod.c,
	src/groupmod.c, src/passwd.c: Use a break even after usage().
This commit is contained in:
nekral-guest 2009-09-05 22:31:29 +00:00
parent ff60398b1c
commit 8806b07bd2
18 changed files with 33 additions and 17 deletions

View File

@ -1,3 +1,13 @@
2009-09-06 Nicolas François <nicolas.francois@centraliens.net>
* src/userdel.c, src/lastlog.c, src/gpasswd.c, src/newusers.c,
src/chpasswd.c, src/groupmems.c, src/usermod.c, src/chgpasswd.c,
src/vipw.c, src/su.c, src/useradd.c, src/groupmod.c, src/passwd.c,
src/groupadd.c, src/chage.c, src/faillog.c, src/chsh.c: Use
booleans for tests.
* src/userdel.c, src/gpasswd.c, src/groupmems.c, src/usermod.c,
src/groupmod.c, src/passwd.c: Use a break even after usage().
2009-09-05 Nicolas François <nicolas.francois@centraliens.net>
* src/gpasswd.c, src/groupmems.c: Split the groupmems and gpasswd

View File

@ -168,7 +168,7 @@ static void usage (int status)
" -M, --maxdays MAX_DAYS set maximim number of days before password\n"
" change to MAX_DAYS\n"
" -W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS\n"
"\n"), status ? stderr : stdout);
"\n"), (E_SUCCESS != status) ? stderr : stdout);
exit (status);
}

View File

@ -116,7 +116,7 @@ static void fail_exit (int code)
*/
static void usage (int status)
{
fprintf (status ? stderr : stdout,
(void) fprintf ((E_SUCCESS != status) ? stderr : stdout,
_("Usage: %s [options]\n"
"\n"
"Options:\n"

View File

@ -114,7 +114,7 @@ static void fail_exit (int code)
*/
static void usage (int status)
{
FILE *usageout = status ? stderr : stdout;
FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
(void) fprintf (usageout,
_("Usage: %s [options]\n"
"\n"

View File

@ -108,7 +108,7 @@ static void usage (int status)
"Options:\n"
" -h, --help display this help message and exit\n"
" -s, --shell SHELL new login shell for the user account\n"
"\n"), status ? stderr : stdout);
"\n"), (E_SUCCESS != status) ? stderr : stdout);
exit (status);
}

View File

@ -82,7 +82,7 @@ static struct stat statbuf; /* fstat buffer for file size */
static void usage (int status)
{
FILE *usageout = status ? stderr : stdout;
FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
(void) fprintf (usageout,
_("Usage: %s [options]\n"
"\n"

View File

@ -130,7 +130,7 @@ static void log_gpasswd_success_gshadow (unused void *arg);
*/
static void usage (int status)
{
FILE *usageout = status ? stderr : stdout;
FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
(void) fprintf (usageout,
_("Usage: %s [option] GROUP\n"
"\n"
@ -278,6 +278,7 @@ static void process_flags (int argc, char **argv)
break;
case 'h':
usage (E_SUCCESS);
break;
case 'M': /* set the list of members */
members = optarg;
if (!is_valid_user_list (members)) {

View File

@ -107,7 +107,7 @@ static void check_perms (void);
*/
static void usage (int status)
{
FILE *usageout = status ? stderr : stdout;
FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
(void) fprintf (usageout,
_("Usage: %s [options] GROUP\n"
"\n"

View File

@ -363,7 +363,7 @@ static void display_members (const char *const *members)
static void usage (int status)
{
FILE *usageout = status ? stderr : stdout;
FILE *usageout = (EXIT_SUCCESS != status) ? stderr : stdout;
(void) fprintf (usageout,
_("Usage: %s [options] [action]\n"
"\n"
@ -414,6 +414,7 @@ static void process_flags (int argc, char **argv)
break;
case 'h':
usage (EXIT_SUCCESS);
break;
case 'l':
list = true;
++exclusive;

View File

@ -115,7 +115,7 @@ static void update_primary_groups (gid_t ogid, gid_t ngid);
static void usage (int status)
{
FILE *usageout = status ? stderr : stdout;
FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
(void) fprintf (usageout,
_("Usage: %s [options] GROUP\n"
"\n"
@ -365,6 +365,7 @@ static void process_flags (int argc, char **argv)
break;
case 'h':
usage (E_SUCCESS);
break;
case 'n':
nflg = true;
group_newname = optarg;

View File

@ -80,7 +80,7 @@ static void usage (int status)
" -h, --help display this help message and exit\n"
" -t, --time DAYS print only lastlog records more recent than DAYS\n"
" -u, --user LOGIN print lastlog record of the specified LOGIN\n"
"\n"), status ? stderr : stdout);
"\n"), (EXIT_SUCCESS != status) ? stderr : stdout);
exit (status);
}

View File

@ -112,7 +112,7 @@ static void close_files (void);
*/
static void usage (int status)
{
FILE *usageout = status ? stderr : stdout;
FILE *usageout = (EXIT_SUCCESS != status) ? stderr : stdout;
(void) fprintf (usageout,
_("Usage: %s [options]\n"
"\n"

View File

@ -180,7 +180,7 @@ static void usage (int status)
" -w, --warndays WARN_DAYS set expiration warning days to WARN_DAYS\n"
" -x, --maxdays MAX_DAYS set maximum number of days before password\n"
" change to MAX_DAYS\n"
"\n"), status ? stderr : stdout);
"\n"), (E_SUCCESS != status) ? stderr : stdout);
exit (status);
}
@ -899,6 +899,7 @@ int main (int argc, char **argv)
break;
case 'h':
usage (E_SUCCESS);
break;
default:
usage (E_BAD_ARG);
}

View File

@ -335,7 +335,7 @@ static void usage (int status)
" --preserve-environment do not reset environment variables, and\n"
" keep the same shell\n"
" -s, --shell SHELL use SHELL instead of the default in passwd\n"
"\n"), status ? stderr : stdout);
"\n"), (E_SUCCESS != status) ? stderr : stdout);
exit (status);
}

View File

@ -683,7 +683,7 @@ static int get_groups (char *list)
*/
static void usage (int status)
{
FILE *usageout = status ? stderr : stdout;
FILE *usageout = (E_SUCCESS != status) ? stderr : stdout;
(void) fprintf (usageout,
_("Usage: %s [options] LOGIN\n"
"\n"

View File

@ -120,7 +120,7 @@ static void usage (int status)
" even if not owned by user\n"
" -h, --help display this help message and exit\n"
" -r, --remove remove home directory and mail spool\n"
"\n"), status ? stderr : stdout);
"\n"), (E_SUCCESS != status) ? stderr : stdout);
exit (status);
}
@ -776,6 +776,7 @@ int main (int argc, char **argv)
break;
case 'h':
usage (E_SUCCESS);
break;
case 'r': /* remove home dir and mailbox */
rflg = true;
break;

View File

@ -302,7 +302,7 @@ static int get_groups (char *list)
*/
static void usage (int status)
{
fprintf (status ? stderr : stdout,
fprintf ((E_SUCCESS != status) ? stderr : stdout,
_("Usage: usermod [options] LOGIN\n"
"\n"
"Options:\n"
@ -978,6 +978,7 @@ static void process_flags (int argc, char **argv)
break;
case 'h':
usage (E_SUCCESS);
break;
case 'l':
if (!is_valid_user_name (optarg)) {
fprintf (stderr,

View File

@ -83,7 +83,7 @@ static void usage (int status)
" -p, --passwd edit passwd database\n"
" -q, --quiet quiet mode\n"
" -s, --shadow edit shadow or gshadow database\n"
"\n"), status ? stderr : stdout);
"\n"), (E_SUCCESS != status) ? stderr : stdout);
exit (status);
}