Hello,

could you please add some code to nbd-client to prevent zombie processes
to show up once it is started?
The following patch fixes it for me but I do not mind calling wait() or
any other way to fix it properly (your way)... mine is just a quick
hack...

Thank you!

diff --git a/nbd-client.c b/nbd-client.c
index dadf95d..1768322 100644
--- a/nbd-client.c
+++ b/nbd-client.c
@@ -444,6 +444,7 @@ int main(int argc, char *argv[]) {
        uint32_t cflags=0;
        uint32_t opts=0;
        sigset_t block, old;
+       struct sigaction sa;
        struct option long_options[] = {
                { "block-size", required_argument, NULL, 'b' },
                { "check", required_argument, NULL, 'c' },
@@ -585,6 +586,11 @@ int main(int argc, char *argv[]) {
                if (daemon(0,0) < 0)
                        err("Cannot detach from terminal");
        }
+
+       memset(&sa, 0, sizeof(sa));
+       sa.sa_handler = SIG_IGN;
+       sigaction(SIGCHLD, &sa, NULL);
+
 #endif 
        do {
 #ifndef NOFORK

-- 
Michal Belczyk Sr.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to