summaryrefslogtreecommitdiff
path: root/AuLock.c
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 /AuLock.c
parent1a8a1b2c68967b48c07b56142799b1020f017027 (diff)
Use configure check for pathconf instead of X_NOT_POSIX #define
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'AuLock.c')
-rw-r--r--AuLock.c7
1 files changed, 3 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;