smdev

suckless mdev
git clone git://git.2f30.org/smdev.git
Log | Files | Refs | README | LICENSE

commit 265d727f2d1caa61e8336b3a36f9e176aa57f5d6
parent 5ce5c84744b108344c59ac30c77ef6a0d2dcde76
Author: sin <sin@2f30.org>
Date:   Wed, 21 Aug 2013 11:20:20 +0100

Call mkpath() with a 022 umask, then restore it to 0

Diffstat:
smdev.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/smdev.c b/smdev.c @@ -113,8 +113,10 @@ create_dev(const char *path) case '=': if (Rule->path[strlen(Rule->path) - 1] == '/') { snprintf(devpath, sizeof(devpath), "/dev/%s", &Rule->path[1]); + umask(022); if (mkpath(devpath, 0755) < 0) eprintf("mkdir %s:", devpath); + umask(0); strcat(devpath, devname); } else { snprintf(devpath, sizeof(devpath),