about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--fq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fq.c b/fq.c
index ebfe6f8..a61240f 100644
--- a/fq.c
+++ b/fq.c
@@ -43,7 +43,7 @@ char buf[8192];
 static int
 islocked(int fd)
 {
-	if (flock(fd, LOCK_EX | LOCK_NB) == -1) {
+	if (flock(fd, LOCK_SH | LOCK_NB) == -1) {
 		return (errno == EWOULDBLOCK);
 	} else {
 		flock(fd, LOCK_UN);
@@ -207,7 +207,7 @@ main(int argc, char *argv[])
 				if (nflag && islocked(fd))
 					break;
 
-				if (flock(fd, LOCK_EX | LOCK_NB) == -1 &&
+				if (flock(fd, LOCK_SH | LOCK_NB) == -1 &&
 				    errno == EWOULDBLOCK) {
 #if defined(USE_INOTIFY)
 					/* any inotify event is good */