summaryrefslogtreecommitdiffstats
path: root/login-utils
diff options
context:
space:
mode:
Diffstat (limited to 'login-utils')
-rw-r--r--login-utils/sulogin.c6
-rw-r--r--login-utils/utmpdump.c5
-rw-r--r--login-utils/vipw.c7
3 files changed, 7 insertions, 11 deletions
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 38ea161c3..fdbda7c87 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -1105,10 +1105,8 @@ int main(int argc, char **argv)
}
signum = sigtimedwait(&set, NULL, &sigwait);
- if (signum != SIGCHLD) {
- if (signum < 0 && errno == EAGAIN)
- break;
- }
+ if (signum != SIGCHLD && signum < 0 && errno == EAGAIN)
+ break;
} while (1);
diff --git a/login-utils/utmpdump.c b/login-utils/utmpdump.c
index 1849a4e93..cf8a50d8f 100644
--- a/login-utils/utmpdump.c
+++ b/login-utils/utmpdump.c
@@ -394,9 +394,8 @@ int main(int argc, char **argv)
in = dump(in, filename, follow, out);
}
- if (out != stdout)
- if (close_stream(out))
- err(EXIT_FAILURE, _("write failed"));
+ if (out != stdout && close_stream(out))
+ err(EXIT_FAILURE, _("write failed"));
if (in && in != stdin)
fclose(in);
diff --git a/login-utils/vipw.c b/login-utils/vipw.c
index 2e343b6ea..d12ea7316 100644
--- a/login-utils/vipw.c
+++ b/login-utils/vipw.c
@@ -354,10 +354,9 @@ int main(int argc, char *argv[])
* which means they can be translated. */
printf(_("Would you like to edit %s now [y/n]? "), orig_file);
- if (fgets(response, sizeof(response), stdin)) {
- if (rpmatch(response) == RPMATCH_YES)
- edit_file(1);
- }
+ if (fgets(response, sizeof(response), stdin) &&
+ rpmatch(response) == RPMATCH_YES)
+ edit_file(1);
}
exit(EXIT_SUCCESS);
}