From 55c5991da3ce7ac4f861ca95156dc38bbaff69ff Mon Sep 17 00:00:00 2001 From: jun7 Date: Sat, 16 Jun 2018 16:52:54 +0900 Subject: [PATCH] Add sh lock to work ex lock --- wyebrun.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wyebrun.c b/wyebrun.c index 407dce5..eaf8c7b 100644 --- a/wyebrun.c +++ b/wyebrun.c @@ -117,6 +117,9 @@ static bool ipcsend(char *exe, char *name, flock(pp, LOCK_EX); fcntl(pp, F_SETFL, 0); //clear O_NONBLOCK to write len > 65536; } + else + flock(pp, LOCK_SH); + ret = write(pp, line, len) == len; close(pp); }