* mkdirp: fixed comments
authorUrban Wallasch <urban.wallasch@freenet.de>
Mon, 11 Nov 2019 10:29:40 +0000 (11:29 +0100)
committerUrban Wallasch <urban.wallasch@freenet.de>
Mon, 11 Nov 2019 10:29:40 +0000 (11:29 +0100)
mkdirp/mkdirp.c
mkdirp/mkdirp.h
mkdirp/mkdirp_test.c

index 502b7f6a75911282a944ce5734a9d80753bf4aee..bde3b5e6bbddf19d4905ea4fcb8acdb6d4a0bdbe 100644 (file)
@@ -1,3 +1,14 @@
+/*
+ * mkdirp.c
+ *
+ * Copyright (c) 2019, Urban Wallasch
+ * BSD 3-Clause License, see LICENSE file for more details.
+ *
+ * Create a directory and its parents, if they do not already exist.
+ *
+ */
+
+
 #include <errno.h>
 #include <string.h>
 
index 9ea4184a1f5e3ba15453dfeeb96ec12e2afd90c4..0cae21e76e0df5b354627fb0a6c048c33b2c0ad1 100644 (file)
@@ -24,13 +24,13 @@ extern "C" {
  *
  * The mkdirp() function creates the directory pathname with the specified
  * mode, if it does not already exist.  If necessary, any missing parent
- * directories are created as part of the process.  The file mode of each
- * created directory is ((mode | 0700) & ~umask & 0777).  The modes of
- * already existing directories are left unchanged.
+ * directories are created as part of the process.  The effective file mode
+ * used for each created directory is ((mode | 0700) & ~umask & 0777).  The
+ * modes of already existing directories are left unchanged.
  *
  * The mkdirp() function returns 0, if the specified directory already
- * exists or was successfully created, or -1 if an error occurred, in
- * which case errno is set appropriately.
+ * existed or was successfully created, or -1 if an error occurred, in which
+ * case errno is set appropriately.
  */
 extern int mkdirp(const char *pathname, mode_t mode);
 
index df7741933f0633da3f4811cbf69f74c9092c49ae..1ee5b68a25e26ad2665e9d71cf2bf628f8a07895 100644 (file)
@@ -1,3 +1,15 @@
+/*
+ * mkdirp_test.c
+ *
+ * Copyright (c) 2019, Urban Wallasch
+ * BSD 3-Clause License, see LICENSE file for more details.
+ *
+ * Simple, non-exhaustive quick check for mkdir.[ch].
+ *
+ * Build with:
+ * gcc -Wall -Wextra -Werror -O2 -omkdirp_test mkdirp.c mkdirp_test.c
+ */
+
 #include <assert.h>
 #include <errno.h>
 #include <stdio.h>