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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-01-12 21:02:56 -05:00
parent ff82c36c79
commit e5d7bce12d
1 changed files with 2 additions and 1 deletions

View File

@ -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();