[PATCH:smproxy 1/7] Replace #ifdef X_NOT_POSIX with explicit check for mktemp function

Alan Coopersmith alan.coopersmith at oracle.com
Sun Nov 24 09:35:21 PST 2013


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 configure.ac |    2 +-
 save.c       |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index c97bb04..1f23bac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,7 +35,7 @@ AC_CONFIG_HEADERS([config.h])
 
 XORG_DEFAULT_OPTIONS
 
-AC_CHECK_FUNCS([mkstemp])
+AC_CHECK_FUNCS([mkstemp mktemp])
 
 # Checks for pkg-config packages
 PKG_CHECK_MODULES(SMPROXY, [sm ice xt xmuu])
diff --git a/save.c b/save.c
index 0f71fd1..5c2a750 100644
--- a/save.c
+++ b/save.c
@@ -310,9 +310,9 @@ unique_filename(char *path, char *prefix, int *pFd)
 #endif
 {
 #ifndef HAVE_MKSTEMP
-#ifndef X_NOT_POSIX
+# ifndef HAVE_MKTEMP
     return ((char *) tempnam (path, prefix));
-#else
+# else /* HAVE_MKTEMP */
     char tempFile[PATH_MAX];
     char *tmp;
 
@@ -326,8 +326,8 @@ unique_filename(char *path, char *prefix, int *pFd)
     }
     else
 	return (NULL);
-#endif
-#else 
+# endif /* HAVE_MKTEMP */
+#else /* HAVE_MKSTEMP */
     char tempFile[PATH_MAX];
     char *ptr;
 
@@ -339,7 +339,7 @@ unique_filename(char *path, char *prefix, int *pFd)
 	*pFd =  mkstemp(ptr);
     }
     return ptr;
-#endif
+#endif /* HAVE_MKSTEMP */
 }
 
 
-- 
1.7.9.2



More information about the xorg-devel mailing list