summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-09-26 16:20:39 +0100
committersin <sin@2f30.org>2014-09-26 16:20:39 +0100
commitdece4cc791d66c75c89caead1b44dafe92227ce2 (patch)
treed935b333a02a752cd761bb784775eb56dffb875d /ratox.c
parentc22deaffa3f61b2ea4577c44b4ec20fb24ea917b (diff)
Style fix
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ratox.c b/ratox.c
index bd22c89..7c228e3 100644
--- a/ratox.c
+++ b/ratox.c
@@ -756,18 +756,22 @@ localinit(void)
r = mkdir(gslots[i].name, 0755);
if (r < 0 && errno != EEXIST)
eprintf("mkdir %s:", gslots[i].name);
+
d = opendir(gslots[i].name);
if (!d)
eprintf("opendir %s:", gslots[i].name);
+
r = dirfd(d);
if (r < 0)
eprintf("dirfd %s:", gslots[i].name);
gslots[i].dirfd = r;
+
for (m = 0; m < LEN(gfiles); m++) {
if (gfiles[m].type == FIFO) {
r = mkfifoat(gslots[i].dirfd, gfiles[m].name, 0644);
if (r < 0 && errno != EEXIST)
eprintf("mkfifoat %s:", gfiles[m].name);
+
r = openat(gslots[i].dirfd, gfiles[m].name, gfiles[m].flags, 0644);
if (r < 0)
eprintf("openat %s:", gfiles[m].name);
@@ -781,6 +785,7 @@ localinit(void)
r = mkdirat(gslots[i].dirfd, gfiles[m].name, 0777);
if (r < 0 && errno != EEXIST)
eprintf("mkdirat %s:", gfiles[m].name);
+
r = openat(gslots[i].dirfd, gfiles[m].name, O_RDONLY | O_DIRECTORY);
if (r < 0)
eprintf("openat %s:", gfiles[m].name);