Return the right value on nbd-client -c
[nbd.git] / nbd-client.c
index 1a2e5e9..8ba9264 100644 (file)
@@ -284,6 +284,7 @@ int main(int argc, char *argv[]) {
                { "sdp", no_argument, NULL, 'S' },
                { "swap", no_argument, NULL, 's' },
                { "timeout", required_argument, NULL, 't' },
+               { 0, 0, 0, 0 }, 
        };
 
        logging();
@@ -330,8 +331,7 @@ int main(int argc, char *argv[]) {
                        blocksize=(int)strtol(optarg, NULL, 0);
                        break;
                case 'c':
-                       check_conn(optarg, 1);
-                       exit(EXIT_SUCCESS);
+                       return check_conn(optarg, 1);
                case 'd':
                        disconnect(optarg);
                        exit(EXIT_SUCCESS);