system: make system functions return error on error

Return -errno from system functions instead of -1 in errors. This
makes it easier to pass along the result without having to go to
errno etc..
This commit is contained in:
Wim Taymans 2019-06-20 17:31:29 +02:00
parent 03eeb945f3
commit 5b7e95c71c
9 changed files with 154 additions and 157 deletions

View file

@ -473,12 +473,10 @@ static int impl_steal_fd(struct pw_protocol_client *client)
return -EIO;
fd = dup(impl->source->fd);
if (fd == -1) {
fd = -errno;
goto out;
}
if (fd < 0)
return -errno;
pw_protocol_client_disconnect(client);
out:
return fd;
}