Add sh lock to work ex lock

This commit is contained in:
jun7 2018-06-16 16:52:54 +09:00
parent 8a85e3a2e4
commit 55c5991da3

View File

@ -117,6 +117,9 @@ static bool ipcsend(char *exe, char *name,
flock(pp, LOCK_EX); flock(pp, LOCK_EX);
fcntl(pp, F_SETFL, 0); //clear O_NONBLOCK to write len > 65536; fcntl(pp, F_SETFL, 0); //clear O_NONBLOCK to write len > 65536;
} }
else
flock(pp, LOCK_SH);
ret = write(pp, line, len) == len; ret = write(pp, line, len) == len;
close(pp); close(pp);
} }