[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] nbd 2.9.16: nbd-client -c exit code is incorrect for disconnected on ubuntu lucid

On Tue, Jul 27, 2010 at 06:08:13PM -0400, Richard Huddleston wrote:
> i'm not the most intelligent linux user/person in general, so perhaps
> i'm doing something stupid
> as you can see, nbd-2.9.15 returns the correct results, and nbd-2.9.16
> always returns 0
> is there an incompatability between the kernel module and the nbd code
> i've downloaded?

No, it's a result of me introducing a bug when rewriting the command
line parsing code. This fixes it:

diff --git a/nbd-client.c b/nbd-client.c
index c98446a..8ba9264 100644
--- a/nbd-client.c
+++ b/nbd-client.c
@@ -331,8 +331,7 @@ int main(int argc, char *argv[]) {
                        blocksize=(int)strtol(optarg, NULL, 0);
                case 'c':
-                       check_conn(optarg, 1);
-                       exit(EXIT_SUCCESS);
+                       return check_conn(optarg, 1);
                case 'd':

I've just applied this to the git master branch, too.

The biometric identification system at the gates of the CIA headquarters
works because there's a guard with a large gun making sure no one is
trying to fool the system.

Reply to: