summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorPeter Seiderer <ps.report@gmx.net>2015-01-25 14:00:27 -0500
committerAnthony G. Basile <blueness@gentoo.org>2015-01-25 14:00:27 -0500
commit2242855594e38a84ec5ce76134c4bc8c164cdf32 (patch)
treeba1ac915757ba178adb0701ee9795d5ff3452f83 /src/shared/util.c
parent5e7fcb69f1821473754378b461d1bf16aa3a1cb3 (diff)
src/shared/util.{c,h}: fix build when mkostemp is not supported
Not all instance of mkostemp were protected with #ifndef HAVE_DECL_MKOSTEMP. We fix this for the definition of the wrapper mkostemp_safe() in the c file and in the header. Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 6ef53b05ef..2dbcf9446c 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1558,6 +1558,7 @@ int getpeercred(int fd, struct ucred *ucred) {
return 0;
}
+#if HAVE_DECL_MKOSTEMP
/* This is much like like mkostemp() but is subject to umask(). */
int mkostemp_safe(char *pattern, int flags) {
_cleanup_umask_ mode_t u;
@@ -1573,7 +1574,7 @@ int mkostemp_safe(char *pattern, int flags) {
return fd;
}
-
+#else
/* This is much like like mkstemp() but is subject to umask(). */
int mkstemp_safe(char *pattern) {
_cleanup_umask_ mode_t u;
@@ -1589,6 +1590,7 @@ int mkstemp_safe(char *pattern) {
return fd;
}
+#endif
int tempfn_xxxxxx(const char *p, char **ret) {
const char *fn;