From cd46bb84ea77fbd4c9a97f782efad3af9c3bda08 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Thu, 11 Jul 2013 10:05:07 +0200 Subject: rename_device: don't wait for lock with lower permissions When running udevadm test as a normal user, rename_device hang for 20 seconds. --- src/rename_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rename_device.c b/src/rename_device.c index c6a99152..8e28154d 100644 --- a/src/rename_device.c +++ b/src/rename_device.c @@ -247,7 +247,9 @@ void take_lock() { write(lockfd,buf,strlen(buf)); close(lockfd); break; - } + } else if (errno == EACCES) + break; + count++; /* If we've slept for 20 seconds, break the lock. */ if (count >= 200) { -- cgit v1.2.1