search for: 5ad818e

Displaying 3 results from an estimated 3 matches for "5ad818e".

2019 Sep 26
5
[PATCH libnbd 1/2] lib: Avoid killing subprocess twice.
If the user calls nbd_kill_subprocess, we shouldn't kill the process again when we close the handle (since the process has likely gone and we might be killing a different process). --- lib/handle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/handle.c b/lib/handle.c index 2af25fe..5ad818e 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -315,6 +315,8 @@ nbd_unlocked_kill_subprocess (struct nbd_handle *h, int signum) return -1; } + h->pid = -1; + return 0; } -- 2.23.0
2019 Sep 26
0
Re: [PATCH libnbd 1/2] lib: Avoid killing subprocess twice.
...shouldn't kill the process > again when we close the handle (since the process has likely gone and > we might be killing a different process). > --- > lib/handle.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/handle.c b/lib/handle.c > index 2af25fe..5ad818e 100644 > --- a/lib/handle.c > +++ b/lib/handle.c > @@ -315,6 +315,8 @@ nbd_unlocked_kill_subprocess (struct nbd_handle *h, int signum) > return -1; > } > > + h->pid = -1; > + Ouch - this means we completely forget about the child process, even if signum ==...
2019 Sep 26
0
[PATCH libnbd 2/2] api: Implement local command with systemd socket activation.
...ing_list (argv); + if (!copy) { + set_error (errno, "copy_string_list"); + return -1; + } + + if (h->argv) + nbd_internal_free_string_list (h->argv); + h->argv = copy; + + return nbd_internal_run (h, cmd_connect_sa); +} diff --git a/lib/handle.c b/lib/handle.c index 5ad818e..18cc8d0 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -129,6 +129,16 @@ nbd_close (struct nbd_handle *h) free_cmd_list (h->cmds_in_flight); free_cmd_list (h->cmds_done); nbd_internal_free_string_list (h->argv); + if (h->sa_sockpath) { + if (h->pid > 0) + kill...