mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
tools: improve error reporting
This commit is contained in:
parent
95906ca52e
commit
7927a66fdd
4 changed files with 26 additions and 10 deletions
|
|
@ -811,29 +811,36 @@ int main(int argc, char *argv[])
|
|||
fprintf(stdout, "set output file %s\n", dot_path);
|
||||
break;
|
||||
default:
|
||||
show_help(argv[0]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
data.loop = pw_main_loop_new(NULL);
|
||||
if (data.loop == NULL)
|
||||
if (data.loop == NULL) {
|
||||
fprintf(stderr, "can't create main loop: %m\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
l = pw_main_loop_get_loop(data.loop);
|
||||
pw_loop_add_signal(l, SIGINT, do_quit, &data);
|
||||
pw_loop_add_signal(l, SIGTERM, do_quit, &data);
|
||||
|
||||
data.context = pw_context_new(l, NULL, 0);
|
||||
if (data.context == NULL)
|
||||
if (data.context == NULL) {
|
||||
fprintf(stderr, "can't create context: %m\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
data.core = pw_context_connect(data.context,
|
||||
pw_properties_new(
|
||||
PW_KEY_REMOTE_NAME, opt_remote,
|
||||
NULL),
|
||||
0);
|
||||
if (data.core == NULL)
|
||||
if (data.core == NULL) {
|
||||
fprintf(stderr, "can't connect: %m\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
data.dot_str = dot_str_new();
|
||||
if (data.dot_str == NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue