summaryrefslogtreecommitdiff
path: root/src/udev/udevd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev/udevd.c')
-rw-r--r--src/udev/udevd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index b9922f51dd..bd650a1f6b 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -1157,7 +1157,11 @@ int main(int argc, char *argv[])
}
/* set umask before creating any file/directory */
- chdir("/");
+ if (chdir("/") == -1) {
+ fprintf(stderr, "Cannot chdir to /\n");
+ log_error("Cannot chdir to /\n");
+ goto exit;
+ }
umask(022);
mkdir("/run/udev", 0755);