commit 92f85920b02ad5c9c4262c2c17778f69779c0604
parent 97879c1e67d0e669f13922295844f0ceb64cd13b
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Wed, 6 Feb 2019 08:37:39 +0000
Rename mkLtemp to mkhtemp; try to make MacOS happy
Diffstat:
6 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/package/deps.mak b/package/deps.mak
@@ -144,10 +144,10 @@ src/libposixplz/execvep_internal.o src/libposixplz/execvep_internal.lo: src/libp
src/libposixplz/execvep_loose.o src/libposixplz/execvep_loose.lo: src/libposixplz/execvep_loose.c src/libposixplz/posixplz-internal.h src/include/skalibs/posixplz.h
src/libposixplz/getpeereid.o src/libposixplz/getpeereid.lo: src/libposixplz/getpeereid.c src/include/skalibs/nonposix.h src/include/skalibs/posixplz.h src/include/skalibs/sysdeps.h
src/libposixplz/memmem.o src/libposixplz/memmem.lo: src/libposixplz/memmem.c src/include/skalibs/posixplz.h src/include/skalibs/sysdeps.h
-src/libposixplz/mkLtemp.o src/libposixplz/mkLtemp.lo: src/libposixplz/mkLtemp.c src/include/skalibs/posixplz.h
src/libposixplz/mkbtemp.o src/libposixplz/mkbtemp.lo: src/libposixplz/mkbtemp.c src/include/skalibs/djbunix.h src/include/skalibs/posixplz.h
src/libposixplz/mkctemp.o src/libposixplz/mkctemp.lo: src/libposixplz/mkctemp.c src/include/skalibs/djbunix.h src/include/skalibs/posixplz.h
src/libposixplz/mkfiletemp.o src/libposixplz/mkfiletemp.lo: src/libposixplz/mkfiletemp.c src/include/skalibs/posixplz.h src/include/skalibs/surf.h
+src/libposixplz/mkhtemp.o src/libposixplz/mkhtemp.lo: src/libposixplz/mkhtemp.c src/include/skalibs/posixplz.h
src/libposixplz/mklinktemp.o src/libposixplz/mklinktemp.lo: src/libposixplz/mklinktemp.c src/include/skalibs/djbunix.h src/libposixplz/posixplz-internal.h src/include/skalibs/posixplz.h
src/libposixplz/mkltemp.o src/libposixplz/mkltemp.lo: src/libposixplz/mkltemp.c src/include/skalibs/posixplz.h
src/libposixplz/mkptemp.o src/libposixplz/mkptemp.lo: src/libposixplz/mkptemp.c src/include/skalibs/djbunix.h src/include/skalibs/posixplz.h
@@ -298,7 +298,7 @@ src/libstddjb/deepsleepuntil.o src/libstddjb/deepsleepuntil.lo: src/libstddjb/de
src/libstddjb/dir_close.o src/libstddjb/dir_close.lo: src/libstddjb/dir_close.c src/include/skalibs/direntry.h
src/libstddjb/dir_fd.o src/libstddjb/dir_fd.lo: src/libstddjb/dir_fd.c src/include/skalibs/direntry.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
src/libstddjb/env_addmodif.o src/libstddjb/env_addmodif.lo: src/libstddjb/env_addmodif.c src/include/skalibs/env.h src/include/skalibs/stralloc.h
-src/libstddjb/env_dump.o src/libstddjb/env_dump.lo: src/libstddjb/env_dump.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/unix-transactional.h
+src/libstddjb/env_dump.o src/libstddjb/env_dump.lo: src/libstddjb/env_dump.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/nonposix.h src/include/skalibs/unix-transactional.h
src/libstddjb/env_get.o src/libstddjb/env_get.lo: src/libstddjb/env_get.c src/include/skalibs/posixplz.h
src/libstddjb/env_get2.o src/libstddjb/env_get2.lo: src/libstddjb/env_get2.c src/include/skalibs/bytestr.h src/include/skalibs/env.h
src/libstddjb/env_len.o src/libstddjb/env_len.lo: src/libstddjb/env_len.c src/include/skalibs/env.h
diff --git a/src/include/skalibs/nonposix.h b/src/include/skalibs/nonposix.h
@@ -53,6 +53,13 @@
#endif
+ /* MacOS: needs this for full SUSv3 conformance. Don't ask. */
+
+#ifndef _DARWIN_C_SOURCE
+#define _DARWIN_C_SOURCE
+#endif
+
+
/* Unfortunately we can't fully avoid #ifdef forests,
because the BSDs are bloody snowflakes. See: setgroups(). */
diff --git a/src/include/skalibs/posixplz.h b/src/include/skalibs/posixplz.h
@@ -51,7 +51,7 @@ extern int mkfiletemp (char *, createfunc_t_ref, mode_t, void *) ;
extern int mklinktemp (char const *, char *, linkfunc_t_ref) ;
extern int mkptemp (char *) ;
extern int mkltemp (char const *, char *) ;
-extern int mkLtemp (char const *, char *) ;
+extern int mkhtemp (char const *, char *) ;
extern int mkctemp (char *, mode_t, dev_t) ;
extern int mkbtemp (char *, mode_t, dev_t) ;
diff --git a/src/libposixplz/mkLtemp.c b/src/libposixplz/mkLtemp.c
@@ -1,10 +0,0 @@
-/* ISC license. */
-
-#include <unistd.h>
-
-#include <skalibs/posixplz.h>
-
-int mkLtemp (char const *src, char *dst)
-{
- return mklinktemp(src, dst, &link) ;
-}
diff --git a/src/libposixplz/mkhtemp.c b/src/libposixplz/mkhtemp.c
@@ -0,0 +1,10 @@
+/* ISC license. */
+
+#include <unistd.h>
+
+#include <skalibs/posixplz.h>
+
+int mkhtemp (char const *src, char *dst)
+{
+ return mklinktemp(src, dst, &link) ;
+}
diff --git a/src/libstddjb/env_dump.c b/src/libstddjb/env_dump.c
@@ -1,5 +1,7 @@
/* ISC license. */
+#include <skalibs/nonposix.h>
+#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>