From 98a5ae664df526c18bac5d4597c3ae165cd0fd20 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 2 Jun 2021 08:11:25 -0700 Subject: solaris: unbundle mkstemp and mkdtemp. * configure: Solaris 10 doesn't have mkdtemp, so we detect it separately from mkstemp, which Solaris 10 does have, producing HAVE_MKSTEMP and MAKE_MKDTEMP config.h symbols. * stream.c (mkdtemp_wrap): Separately surround with #if HAVE_MKDTEMP. (mkstemp_wrap): Reduce scope of #if HAVE_MKSTEMP only around this function. Bugfix here: in the #else case of #if HAVE_MKSTEMPS, we are calling the mkstemps function instead of mkstemp. --- configure | 23 +++++++++++++++++++++-- stream.c | 12 +++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 10027028..3e97ed13 100755 --- a/configure +++ b/configure @@ -3228,7 +3228,7 @@ if [ -z "$have_winsize" ] ; then printf "no\n" fi -printf "Checking for mkstemp/mkdtemp ... " +printf "Checking for mkstemp ... " cat > conftest.c < @@ -3237,7 +3237,6 @@ int main(int argc, char **argv) { char templ[] = "abcXXXXXX"; int fd = mkstemp(templ); - char *s = mkdtemp(templ); return 0; } ! @@ -3249,6 +3248,26 @@ else printf "no\n" fi +printf "Checking for mkdtemp ... " + +cat > conftest.c < + +int main(int argc, char **argv) +{ + char templ[] = "abcXXXXXX"; + char *s = mkdtemp(templ); + return 0; +} +! + +if conftest ; then + printf "yes\n" + printf "#define HAVE_MKDTEMP 1\n" >> config.h +else + printf "no\n" +fi + printf "Checking for mkstemps ... " cat > conftest.c <