summaryrefslogtreecommitdiffstats
path: root/usr.sbin/autofs/common.c
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2014-10-09 15:35:28 +0000
committermelifaro <melifaro@FreeBSD.org>2014-10-09 15:35:28 +0000
commitd23efba7dd470e247cbcacf9ec6cf642d02d5b8c (patch)
tree6d2822f6a5ff6c5c487b859a557d076b53b03c46 /usr.sbin/autofs/common.c
parentcab1d703b61e2216f130c6d1a23ca70b2b322386 (diff)
parentc47600c4ec062b8225ac1d48197a2a1de778760d (diff)
downloadFreeBSD-src-d23efba7dd470e247cbcacf9ec6cf642d02d5b8c.zip
FreeBSD-src-d23efba7dd470e247cbcacf9ec6cf642d02d5b8c.tar.gz
Sync to HEAD@r272825.
Diffstat (limited to 'usr.sbin/autofs/common.c')
-rw-r--r--usr.sbin/autofs/common.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c
index cefbcc8..e6db682 100644
--- a/usr.sbin/autofs/common.c
+++ b/usr.sbin/autofs/common.c
@@ -169,17 +169,12 @@ create_directory(const char *path)
if (component == NULL)
break;
concat(&partial, &component);
- //log_debugx("checking \"%s\" for existence", partial);
- error = access(partial, F_OK);
- if (error == 0)
- continue;
- if (errno != ENOENT)
- log_err(1, "cannot access %s", partial);
- log_debugx("directory %s does not exist, creating",
- partial);
+ //log_debugx("creating \"%s\"", partial);
error = mkdir(partial, 0755);
- if (error != 0)
- log_err(1, "cannot create %s", partial);
+ if (error != 0 && errno != EEXIST) {
+ log_warn("cannot create %s", partial);
+ return;
+ }
}
free(tofree);
OpenPOWER on IntegriCloud