diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-08-28 14:08:35 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-08-28 14:08:35 +0200 |
commit | 7a28310a3ed18524c0ec7ee97f7f48e95b1d92a9 (patch) | |
tree | b8c46ce45ecff2f255f465d045536a48a4ce4b64 | |
parent | 0eae839cb19f9384e742fb94e102042d25b89780 (diff) | |
download | nq-7a28310a3ed18524c0ec7ee97f7f48e95b1d92a9.tar.gz nq-7a28310a3ed18524c0ec7ee97f7f48e95b1d92a9.tar.xz nq-7a28310a3ed18524c0ec7ee97f7f48e95b1d92a9.zip |
nq: mkdir $NQDIR
-rw-r--r-- | nq.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nq.c b/nq.c index c5c7223..a324bd3 100644 --- a/nq.c +++ b/nq.c @@ -114,6 +114,13 @@ usage: if (!path) path = "."; + if (mkdir(path, 0777) < 0) { + if (errno != EEXIST) { + perror("mkdir"); + exit(111); + } + } + dirfd = open(path, O_RDONLY); if (dirfd < 0) { perror("dir open"); |