summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorSami Kerola2016-07-04 23:09:10 +0200
committerSami Kerola2016-07-21 22:14:33 +0200
commit74ce680a3ef90503b26da0a34f04cf725f6c5beb (patch)
tree307baa695e1c36c7a7855718468d9913ddf96bc1 /term-utils/agetty.c
parentagetty: call uname() only when necessary (diff)
downloadkernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.tar.gz
kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.tar.xz
kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.zip
misc: simplify if clauses [oclint]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index b73884828..07d82b9fb 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -502,21 +502,16 @@ int main(int argc, char **argv)
login_argv[login_argc] = NULL; /* last login argv */
- if (options.chroot) {
- if (chroot(options.chroot) < 0)
- log_err(_("%s: can't change root directory %s: %m"),
- options.tty, options.chroot);
- }
- if (options.chdir) {
- if (chdir(options.chdir) < 0)
- log_err(_("%s: can't change working directory %s: %m"),
- options.tty, options.chdir);
- }
- if (options.nice) {
- if (nice(options.nice) < 0)
- log_warn(_("%s: can't change process priority: %m"),
- options.tty);
- }
+ if (options.chroot && chroot(options.chroot) < 0)
+ log_err(_("%s: can't change root directory %s: %m"),
+ options.tty, options.chroot);
+ if (options.chdir && chdir(options.chdir) < 0)
+ log_err(_("%s: can't change working directory %s: %m"),
+ options.tty, options.chdir);
+ if (options.nice && nice(options.nice) < 0)
+ log_warn(_("%s: can't change process priority: %m"),
+ options.tty);
+
free(options.osrelease);
#ifdef DEBUGGING
if (close_stream(dbf) != 0)