mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
avoid error(), it's not defined on musl
This commit is contained in:
parent
37e66c9e55
commit
0720e375a1
4 changed files with 51 additions and 36 deletions
|
|
@ -17,7 +17,6 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <error.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -73,7 +72,7 @@ inspect_node_params(struct data *data, struct spa_node *node)
|
|||
data->type.param.idList, &idx1,
|
||||
NULL, ¶m, &b)) <= 0) {
|
||||
if (res != 0)
|
||||
error(0, -res, "enum_params");
|
||||
printf("error enum_params: %s", spa_strerror(res));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +87,7 @@ inspect_node_params(struct data *data, struct spa_node *node)
|
|||
id, &idx2,
|
||||
NULL, ¶m, &b)) <= 0) {
|
||||
if (res != 0)
|
||||
error(0, -res, "enum_params %d", id);
|
||||
printf("error enum_params %d: %s", id, spa_strerror(res));
|
||||
break;
|
||||
}
|
||||
spa_debug_pod(0, data->map, param);
|
||||
|
|
@ -115,7 +114,7 @@ inspect_port_params(struct data *data, struct spa_node *node,
|
|||
data->type.param.idList, &idx1,
|
||||
NULL, ¶m, &b)) <= 0) {
|
||||
if (res != 0)
|
||||
error(0, -res, "port_enum_params");
|
||||
printf("error port_enum_params: %s", spa_strerror(res));
|
||||
break;
|
||||
}
|
||||
spa_pod_object_parse(param,
|
||||
|
|
@ -130,7 +129,7 @@ inspect_port_params(struct data *data, struct spa_node *node,
|
|||
id, &idx2,
|
||||
NULL, ¶m, &b)) <= 0) {
|
||||
if (res != 0)
|
||||
error(0, -res, "port_enum_params");
|
||||
printf("error port_enum_params %d: %s", id, spa_strerror(res));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -200,10 +199,10 @@ static void inspect_factory(struct data *data, const struct spa_handle_factory *
|
|||
printf("factory interfaces:\n");
|
||||
for (index = 0;;) {
|
||||
if ((res = spa_handle_factory_enum_interface_info(factory, &info, &index)) <= 0) {
|
||||
if (res == 0)
|
||||
break;
|
||||
else
|
||||
error(0, -res, "spa_handle_factory_enum_interface_info");
|
||||
if (res != 0)
|
||||
printf("error spa_handle_factory_enum_interface_info: %s",
|
||||
spa_strerror(res));
|
||||
break;
|
||||
}
|
||||
printf(" interface: '%s'\n", info->type);
|
||||
}
|
||||
|
|
@ -221,10 +220,10 @@ static void inspect_factory(struct data *data, const struct spa_handle_factory *
|
|||
uint32_t interface_id;
|
||||
|
||||
if ((res = spa_handle_factory_enum_interface_info(factory, &info, &index)) <= 0) {
|
||||
if (res == 0)
|
||||
break;
|
||||
else
|
||||
error(0, -res, "spa_handle_factory_enum_interface_info");
|
||||
if (res != 0)
|
||||
printf("error spa_handle_factory_enum_interface_info: %s",
|
||||
spa_strerror(res));
|
||||
break;
|
||||
}
|
||||
printf(" interface: '%s'\n", info->type);
|
||||
|
||||
|
|
@ -314,7 +313,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if ((res = enum_func(&factory, &index)) <= 0) {
|
||||
if (res != 0)
|
||||
error(0, -res, "enum_func");
|
||||
printf("error enum_func: %s", spa_strerror(res));
|
||||
break;
|
||||
}
|
||||
inspect_factory(&data, factory);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue