aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rc/runscript.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index e504e4a9..0eea335f 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -311,8 +311,12 @@ write_prefix(const char *buffer, size_t bytes, bool *prefixed)
lock_fd = open(PREFIX_LOCK, O_WRONLY | O_CREAT, 0664);
if (lock_fd != -1) {
- if (flock(lock_fd, LOCK_EX) != 0)
- eerror("flock() failed: %s", strerror(errno));
+ while (flock(lock_fd, LOCK_EX) != 0) {
+ if (errno != EINTR) {
+ eerror("flock() failed: %s", strerror(errno));
+ break;
+ }
+ }
}
#ifdef RC_DEBUG
else