Do the check_conn in the child, not the parent nbd-3.0
authorWouter Verhelst <w@uter.be>
Tue, 21 Feb 2012 10:04:32 +0000 (11:04 +0100)
committerWouter Verhelst <w@uter.be>
Tue, 21 Feb 2012 10:04:32 +0000 (11:04 +0100)
nbd-client.c

index 6ad9d55bbe4c1335a32ffc2d17638a5cb46388e3..943f3cecb8eca97d29cd272ec98839000eb7225a 100644 (file)
@@ -453,7 +453,7 @@ int main(int argc, char *argv[]) {
 #endif
        do {
 #ifndef NOFORK
-               if (fork()) {
+               if (!fork()) {
                        /* Due to a race, the kernel NBD driver cannot
                         * call for a reread of the partition table
                         * in the handling of the NBD_DO_IT ioctl().