From 5c01ef69eee7dfe925c97558153fcd5e116252c6 Mon Sep 17 00:00:00 2001 From: "Matthew D. Fuller" Date: Mon, 5 Sep 2011 10:31:14 -0500 Subject: 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 Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith --- AuLock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'AuLock.c') 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); -- cgit v1.2.3