diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-01-13 03:02:56 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-01-18 21:21:28 +0100 |
commit | e5d7bce12d95b38e592a2561b49a42d033cc82c1 (patch) | |
tree | c6903f948a9c8e16f001f9a31c1de88ababf5ab6 /src/udev | |
parent | journald: do not free uninitialized pointer in error path (diff) | |
download | systemd-e5d7bce12d95b38e592a2561b49a42d033cc82c1.tar.xz systemd-e5d7bce12d95b38e592a2561b49a42d033cc82c1.zip |
udevd: initialize fds to -1 and close them before exiting
Little change in practice, because the program will exit soon
afterwards, but the standard style of closing all fds is now followed.
Also gets rid of gcc warning about fd_ctrl and fd_uevent being
unitialized.
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udevd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 366e7fbb87..8627a81ec2 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1652,7 +1652,8 @@ exit: int main(int argc, char *argv[]) { _cleanup_free_ char *cgroup = NULL; - int r, fd_ctrl, fd_uevent; + _cleanup_close_ int fd_ctrl = -1, fd_uevent = -1; + int r; log_set_target(LOG_TARGET_AUTO); log_parse_environment(); |