From: Urban Wallasch Date: Mon, 11 Nov 2019 10:29:40 +0000 (+0100) Subject: * mkdirp: fixed comments X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=3d52b4b1125724eb6808b1420c138b0c4be10df4;p=oddbits.git * mkdirp: fixed comments --- diff --git a/mkdirp/mkdirp.c b/mkdirp/mkdirp.c index 502b7f6..bde3b5e 100644 --- a/mkdirp/mkdirp.c +++ b/mkdirp/mkdirp.c @@ -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 #include diff --git a/mkdirp/mkdirp.h b/mkdirp/mkdirp.h index 9ea4184..0cae21e 100644 --- a/mkdirp/mkdirp.h +++ b/mkdirp/mkdirp.h @@ -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); diff --git a/mkdirp/mkdirp_test.c b/mkdirp/mkdirp_test.c index df77419..1ee5b68 100644 --- a/mkdirp/mkdirp_test.c +++ b/mkdirp/mkdirp_test.c @@ -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 #include #include