[PATCH] Improve the handling of "normal" locking collisions.

Matthew D. Fuller fullermd at over-yonder.net
Mon Sep 5 08:31:14 PDT 2011


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 at over-yonder.net>
---
 AuLock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/AuLock.c b/AuLock.c
index c236027..91d0f31 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);
-- 
1.7.6


--T4sUOijqQbZv57TR--


More information about the xorg-devel mailing list