summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2010-09-22 21:08:16 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2010-09-22 21:08:25 -0700
commitf8abda9a850e55fd6370e2d314335d88af8b19be (patch)
tree12bc458a8d6ae78cad0bc5671afcf788e789e97a
parent61aef1760a65184ecd438419f5de545e3b3e36fd (diff)
Use AC_CHECK_FUNCS / default name for mkstemp
No longer need to maintain #ifdef compatibility with the names used in the monolith Imakefiles. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--configure.ac3
-rw-r--r--save.c12
2 files changed, 7 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 0281dfd..bb6d66b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,8 +34,7 @@ AM_CONFIG_HEADER(config.h)
XORG_DEFAULT_OPTIONS
-AC_CHECK_FUNC([mkstemp],
- AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the "mkstemp" function.]))
+AC_CHECK_FUNCS([mkstemp])
# Checks for pkg-config packages
PKG_CHECK_MODULES(SMPROXY, sm xt xmuu)
diff --git a/save.c b/save.c
index 8510f1e..127cdeb 100644
--- a/save.c
+++ b/save.c
@@ -28,7 +28,7 @@ Author: Ralph Mor, X Consortium
/* $XFree86: xc/programs/smproxy/save.c,v 1.7 2001/01/17 23:45:04 dawes Exp $ */
#include "smproxy.h"
-#ifdef HAS_MKSTEMP
+#ifdef HAVE_MKSTEMP
#include <unistd.h>
#endif
@@ -41,7 +41,7 @@ static int write_counted_string ( FILE *file, char *string );
static int read_byte ( FILE *file, unsigned char *bp );
static int read_short ( FILE *file, unsigned short *shortp );
static int read_counted_string ( FILE *file, char **stringp );
-#ifndef HAS_MKSTEMP
+#ifndef HAVE_MKSTEMP
static char * unique_filename ( char *path, char *prefix );
#else
static char * unique_filename ( char *path, char *prefix, int *pFd );
@@ -301,7 +301,7 @@ ReadProxyFile(char *filename)
-#ifndef HAS_MKSTEMP
+#ifndef HAVE_MKSTEMP
static char *
unique_filename(char *path, char *prefix)
#else
@@ -309,7 +309,7 @@ static char *
unique_filename(char *path, char *prefix, int *pFd)
#endif
{
-#ifndef HAS_MKSTEMP
+#ifndef HAVE_MKSTEMP
#ifndef X_NOT_POSIX
return ((char *) tempnam (path, prefix));
#else
@@ -349,7 +349,7 @@ WriteProxyFile(void)
{
FILE *proxyFile = NULL;
char *filename = NULL;
-#ifdef HAS_MKSTEMP
+#ifdef HAVE_MKSTEMP
int fd;
#endif
char *path;
@@ -364,7 +364,7 @@ WriteProxyFile(void)
path = ".";
}
-#ifndef HAS_MKSTEMP
+#ifndef HAVE_MKSTEMP
if ((filename = unique_filename (path, ".prx")) == NULL)
goto bad;