diff options
author | Tom Gundersen <teg@jklm.no> | 2014-09-18 18:52:43 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-09-18 18:52:43 -0400 |
commit | 3a9daa4bedde6589e22c0d838e3c3b93f4a99f2d (patch) | |
tree | 8a752c32dfec018b9b1cbcb8f06c851b27b74cae /src/udev | |
parent | 2f7510f3124e48fecd3a9f59749c33ae05041ec6 (diff) |
udevd: check return of various functions
One reported by Coverity. Fixes CID #996252.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udevd.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 43852528b2..a3f971c649 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1165,13 +1165,26 @@ int main(int argc, char *argv[]) { goto exit; } - label_init("/dev"); + r = label_init("/dev"); + if (r < 0) { + log_error("could not initialize labelling: %s", strerror(-r)); + goto exit; + } /* set umask before creating any file/directory */ - chdir("/"); + r = chdir("/"); + if (r < 0) { + log_error("could not change dir to /: %m"); + goto exit; + } + umask(022); - mkdir("/run/udev", 0755); + r = mkdir("/run/udev", 0755); + if (r < 0) { + log_error("could not create /run/udev: %m"); + goto exit; + } dev_setup(NULL); static_dev_create_from_modules(udev); |