1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

common: Allow building of mkdir_p.c for Windows.

* common/mkdir_p.c: Change license and comment debug statements.
(amkdir_p, mkdir_p): Fail on malloc error and use default_errsource to
build an error code.  Change return value to gpg_error_t.
(amkdir_p): Use gnupg_mkdir.

* common/membuf.c: Include util.h first to avoid redefined macro
warnings.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-10-08 16:42:14 +02:00
parent d7b8e76f99
commit 4c29852590
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 94 additions and 64 deletions

View file

@ -3,12 +3,22 @@
*
* This file is part of GnuPG.
*
* GnuPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* This file is free software; you can redistribute it and/or modify
* it under the terms of either
*
* GnuPG is distributed in the hope that it will be useful,
* - the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
* or
*
* - the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* or both in parallel, as here.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -29,7 +39,7 @@
first try to create the directory "foo/bar" and then the directory
"foo/bar/xyzzy". On success returns 0, otherwise an error code is
returned. */
int mkdir_p (char *directory_component, ...) GPGRT_ATTR_SENTINEL(0);
gpg_error_t mkdir_p (char *directory_component, ...) GPGRT_ATTR_SENTINEL(0);
/* Like mkdir_p, but DIRECTORY_COMPONENTS is a NULL terminated
array, e.g.:
@ -37,6 +47,6 @@ int mkdir_p (char *directory_component, ...) GPGRT_ATTR_SENTINEL(0);
char **dirs = { "foo", "bar", NULL };
amkdir_p (dirs);
*/
int amkdir_p (char **directory_components);
gpg_error_t amkdir_p (char **directory_components);
#endif