mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb: Use ctdb_wait_for_process_to_exit()
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
907a5a6f1b
commit
6695fa50ae
@ -1865,10 +1865,7 @@ int ctdb_start_revoke_ro_record(struct ctdb_context *ctdb, struct ctdb_db_contex
|
||||
|
||||
child_finished:
|
||||
sys_write(rc->fd[1], &c, 1);
|
||||
/* make sure we die when our parent dies */
|
||||
while (ctdb_kill(ctdb, parent, 0) == 0 || errno != ESRCH) {
|
||||
sleep(5);
|
||||
}
|
||||
ctdb_wait_for_process_to_exit(parent);
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
|
@ -182,8 +182,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
send_result(write_fd, result);
|
||||
|
||||
while (kill(ppid, 0) == 0 || errno != ESRCH) {
|
||||
sleep(5);
|
||||
}
|
||||
ctdb_wait_for_process_to_exit(ppid);
|
||||
return 0;
|
||||
}
|
||||
|
@ -647,10 +647,7 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
|
||||
}
|
||||
|
||||
sys_write(state->fd[1], &cc, 1);
|
||||
/* make sure we die when our parent dies */
|
||||
while (ctdb_kill(ctdb, parent, 0) == 0 || errno != ESRCH) {
|
||||
sleep(5);
|
||||
}
|
||||
ctdb_wait_for_process_to_exit(parent);
|
||||
_exit(0);
|
||||
}
|
||||
close(state->fd[1]);
|
||||
|
@ -3824,10 +3824,7 @@ int32_t ctdb_control_reload_public_ips(struct ctdb_context *ctdb, struct ctdb_re
|
||||
}
|
||||
|
||||
sys_write(h->fd[1], &res, 1);
|
||||
/* make sure we die when our parent dies */
|
||||
while (ctdb_kill(ctdb, parent, 0) == 0 || errno != ESRCH) {
|
||||
sleep(5);
|
||||
}
|
||||
ctdb_wait_for_process_to_exit(parent);
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
|
@ -260,9 +260,7 @@ static struct ctdb_traverse_local_handle *ctdb_traverse_local(struct ctdb_db_con
|
||||
|
||||
sys_write(h->fd[1], &res, sizeof(res));
|
||||
|
||||
while (ctdb_kill(ctdb, parent, 0) == 0 || errno != ESRCH) {
|
||||
sleep(5);
|
||||
}
|
||||
ctdb_wait_for_process_to_exit(parent);
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
|
@ -276,10 +276,7 @@ static struct childwrite_handle *ctdb_childwrite(
|
||||
|
||||
sys_write(result->fd[1], &c, 1);
|
||||
|
||||
/* make sure we die when our parent dies */
|
||||
while (ctdb_kill(ctdb_db->ctdb, parent, 0) == 0 || errno != ESRCH) {
|
||||
sleep(5);
|
||||
}
|
||||
ctdb_wait_for_process_to_exit(parent);
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user