summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-30 10:55:26 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-30 10:55:26 -0700
commit325f5282bc1d93b72b0b05037245cf130970fa38 (patch)
tree02dd6a2fdc046a182dbd9f56c596b8f1014d8284
parent1a8a1b2c68967b48c07b56142799b1020f017027 (diff)
Use configure check for pathconf instead of X_NOT_POSIX #define
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--AuLock.c7
-rw-r--r--configure.ac4
2 files changed, 7 insertions, 4 deletions
diff --git a/AuLock.c b/AuLock.c
index 7bf9e5d..3ae7596 100644
--- a/AuLock.c
+++ b/AuLock.c
@@ -84,7 +84,7 @@ long dead)
(void) close (creat_fd);
}
if (creat_fd != -1) {
-#ifndef X_NOT_POSIX
+#ifdef HAVE_PATHCONF
/* The file system may not support hard links, and pathconf should tell us that. */
if (1 == pathconf(creat_name, _PC_LINK_MAX)) {
if (-1 == rename(creat_name, link_name)) {
@@ -93,8 +93,9 @@ long dead)
} else {
return LOCK_SUCCESS;
}
- } else {
+ } else
#endif
+ {
if (link (creat_name, link_name) != -1)
return LOCK_SUCCESS;
if (errno == ENOENT) {
@@ -103,9 +104,7 @@ long dead)
}
if (errno != EEXIST)
return LOCK_ERROR;
-#ifndef X_NOT_POSIX
}
-#endif
}
(void) sleep ((unsigned) timeout);
--retries;
diff --git a/configure.ac b/configure.ac
index 62a4717..e55cfce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,7 @@ AC_INIT([libXau], [1.0.7],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXau])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
+AC_USE_SYSTEM_EXTENSIONS
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -43,6 +44,9 @@ XORG_DEFAULT_OPTIONS
# Checks for programs.
AC_PROG_LN_S
+# Checks for library functions.
+AC_CHECK_FUNCS([pathconf])
+
# Obtain compiler/linker options for depedencies
PKG_CHECK_MODULES(XAU, xproto)