resource: fix errno printout in error message

res holds the real error code at this point in the code,
errno needs to be set so that %m can work below
This commit is contained in:
George Kiagiadakis 2020-06-04 16:14:17 +03:00 committed by Wim Taymans
parent 2ae621c975
commit 1c86ed8263

View file

@ -72,7 +72,7 @@ struct pw_resource *pw_resource_new(struct pw_impl_client *client,
}
if ((res = pw_map_insert_at(&client->objects, id, this)) < 0) {
res = -errno;
errno = -res;
pw_log_error(NAME" %p: can't add id %u for client %p: %m",
this, id, client);
goto error_clean;