Browse Source

Change returncodes of jackd on success

`--help` and `--version` do not result in server failures.
Instead of returning the default `-1`, return a more reasonable `0`.
pull/665/head
Fabian Koller 5 years ago
parent
commit
729adb4261
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      common/Jackdmp.cpp

+ 6
- 5
common/Jackdmp.cpp View File

@@ -253,8 +253,6 @@ void print_version()
printf( "jackdmp version " VERSION " tmpdir " printf( "jackdmp version " VERSION " tmpdir "
jack_server_dir " protocol %d" "\n", jack_server_dir " protocol %d" "\n",
JACK_PROTOCOL_VERSION); JACK_PROTOCOL_VERSION);
exit(-1);

} }


int main(int argc, char** argv) int main(int argc, char** argv)
@@ -269,6 +267,7 @@ int main(int argc, char** argv)
for(int a = 1; a < argc; ++a) { for(int a = 1; a < argc; ++a) {
if( !strcmp(argv[a], "--version") || !strcmp(argv[a], "-V") ) { if( !strcmp(argv[a], "--version") || !strcmp(argv[a], "-V") ) {
print_version(); print_version();
return 0;
} }
} }
const char *options = "-d:X:I:P:uvshrRL:STFl:t:mn:p:C:" const char *options = "-d:X:I:P:uvshrRL:STFl:t:mn:p:C:"
@@ -495,11 +494,13 @@ int main(int argc, char** argv)
} }
break; break;


case 'h':
usage(stdout, server_ctl);
return_value = 0;
goto destroy_server;

default: default:
fprintf(stderr, "unknown option character %c\n", optopt); fprintf(stderr, "unknown option character %c\n", optopt);
/*fallthru*/

case 'h':
usage(stdout, server_ctl); usage(stdout, server_ctl);
goto destroy_server; goto destroy_server;
} }


Loading…
Cancel
Save