invalid pointer was passed to free()
[project/procd.git] / mkdev.c
diff --git a/mkdev.c b/mkdev.c
index d507939..0f55554 100644 (file)
--- a/mkdev.c
+++ b/mkdev.c
@@ -47,12 +47,15 @@ static bool find_pattern(const char *name)
 
 static void make_dev(const char *path, bool block, int major, int minor)
 {
+       unsigned int oldumask = umask(0);
        unsigned int _mode = mode | (block ? S_IFBLK : S_IFCHR);
+
        DEBUG(2, "Creating %s device %s(%d,%d)\n",
                block ? "block" : "character",
                path, major, minor);
 
        mknod(path, _mode, makedev(major, minor));
+       umask(oldumask);
 }
 
 static void find_devs(bool block)