mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
ctdb-mutex: Exit immediately if the lock isn't taken
There is no need to wait until the parent kills the helper. The parent will get the initial response, indicating contention or similar, and will then get a separate event indicating that the pipe is gone. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
d716be19ea
commit
2f768a090e
@ -101,6 +101,10 @@ int main(int argc, char *argv[])
|
||||
result = fcntl_lock(file, &fd);
|
||||
sys_write(STDOUT_FILENO, &result, 1);
|
||||
|
||||
if (result != '0') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctdb_wait_for_process_to_exit(ppid);
|
||||
|
||||
if (fd != -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user