summaryrefslogtreecommitdiff
path: root/src/udev/udevd.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-18 19:07:02 +0200
committerTom Gundersen <teg@jklm.no>2014-09-18 19:10:23 +0200
commitd457ff8319b1e7c522c146f75e272f1226f4720c (patch)
treeaa62a3eb095f88857bcf44f8f222b9f506da3dc3 /src/udev/udevd.c
parent6f5cf8a8b1de763383f7382821147e538b7dbd6d (diff)
udevd: check return of various functions
One reported by Coverity. Fixes CID #996252.
Diffstat (limited to 'src/udev/udevd.c')
-rw-r--r--src/udev/udevd.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 95c6468029..9210da6c47 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -1139,13 +1139,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);