summaryrefslogtreecommitdiffstats
path: root/common/mkdir_p.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2015-10-08 16:42:14 +0200
committerWerner Koch <wk@gnupg.org>2015-10-08 16:42:14 +0200
commit4c298525903f844eee95ecbcdc45f5ac034fa148 (patch)
tree6f085badc4c0066dba198f994caec0045caafa9e /common/mkdir_p.h
parentgpg: Add option --print-dane-records. (diff)
downloadgnupg2-4c298525903f844eee95ecbcdc45f5ac034fa148.tar.xz
gnupg2-4c298525903f844eee95ecbcdc45f5ac034fa148.zip
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>
Diffstat (limited to '')
-rw-r--r--common/mkdir_p.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/common/mkdir_p.h b/common/mkdir_p.h
index ddf412be0..0a6cf3d68 100644
--- a/common/mkdir_p.h
+++ b/common/mkdir_p.h
@@ -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