summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew D. Fuller <fullermd@over-yonder.net>2011-09-05 10:31:14 -0500
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-20 17:52:43 -0700
commit5c01ef69eee7dfe925c97558153fcd5e116252c6 (patch)
tree09bf04c120b0da64e64ba16b625efadfbf8a44f9
parent8fd15eb0149cec75d69a27b1f8ec3ce092465b80 (diff)
Improve the handling of "normal" locking collisions.
EEXIST is a perfectly normal and expected errno for open(O_CREAT | O_EXCL), and is a signal to loop around and retry, not return with an error. Signed-off-by: Matthew D. Fuller <fullermd@over-yonder.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--AuLock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/AuLock.c b/AuLock.c
index 1eab79a..a816b24 100644
--- a/AuLock.c
+++ b/AuLock.c
@@ -81,7 +81,7 @@ long dead)
if (creat_fd == -1) {
creat_fd = open (creat_name, O_WRONLY | O_CREAT | O_EXCL, 0600);
if (creat_fd == -1) {
- if (errno != EACCES)
+ if (errno != EACCES && errno != EEXIST)
return LOCK_ERROR;
} else
(void) close (creat_fd);