summaryrefslogtreecommitdiffstats
path: root/misc-utils/uuidd.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 /misc-utils/uuidd.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 'misc-utils/uuidd.c')
-rw-r--r--misc-utils/uuidd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c
index 4b1782ae1..a3fe83044 100644
--- a/misc-utils/uuidd.c
+++ b/misc-utils/uuidd.c
@@ -371,9 +371,8 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
if (ftruncate(fd_pidfile, 0))
err(EXIT_FAILURE, _("could not truncate file: %s"), pidfile_path);
write_all(fd_pidfile, reply_buf, strlen(reply_buf));
- if (fd_pidfile > 1)
- if (close_fd(fd_pidfile) != 0) /* Unlock the pid file */
- err(EXIT_FAILURE, _("write failed: %s"), pidfile_path);
+ if (fd_pidfile > 1 && close_fd(fd_pidfile) != 0)
+ err(EXIT_FAILURE, _("write failed: %s"), pidfile_path);
}
}