From 1c86ed8263fe8862f49e374f5521df6b3e814717 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Thu, 4 Jun 2020 16:14:17 +0300 Subject: [PATCH] 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 --- src/pipewire/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipewire/resource.c b/src/pipewire/resource.c index 60fd95d4b..f77aa05d0 100644 --- a/src/pipewire/resource.c +++ b/src/pipewire/resource.c @@ -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;