From 74ce680a3ef90503b26da0a34f04cf725f6c5beb Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 4 Jul 2016 22:09:10 +0100 Subject: misc: simplify if clauses [oclint] Signed-off-by: Sami Kerola --- term-utils/agetty.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'term-utils/agetty.c') 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) -- cgit v1.2.3-55-g7522