Put the -nofork check on the right spot
authorWouter Verhelst <w@uter.be>
Thu, 15 Oct 2009 17:22:19 +0000 (19:22 +0200)
committerWouter Verhelst <w@uter.be>
Thu, 15 Oct 2009 17:22:19 +0000 (19:22 +0200)
commit859706ccb165b702b3280d2235026ff4ab2b03e3
treec719ae3fe5112a53eae684d83dec3ab91f07e731
parent7411b22e6a39d64513e3f803a5d8d2bdb9e3f493
Put the -nofork check on the right spot

nbd-client will fork in two occasions: once when going daemon, once when
forking itself off to be able to open the device so we can trigger the
kernel to reread its partition table (if any), which in turn will cause
udev to DTRT.

The NOFORK macros were written in to make debugging simpeler, and
predate the daemon() thing. I think. Anyhow, what's useful for code
debugging is not necessarily useful for runtime debugging; so this moves
the daemon() call inside the macros, makes it not be called if -nofork
has been specified, and changes the code so that the partition table
reread is still triggered even if -nofork has been specified.
nbd-client.c