pulse-server: make control flow easier to unserstand

Use a switch statement to make the control flow
a bit easier to understand.
This commit is contained in:
Barnabás Pőcze 2021-05-31 20:27:21 +02:00
parent 87c00a6f00
commit bc6adbe15d

View file

@ -5630,15 +5630,19 @@ on_client_data(void *data, int fd, uint32_t mask)
return;
error:
if (res == -EPIPE)
switch (res) {
case -EPIPE:
pw_log_info(NAME" %p: client:%p [%s] disconnected", impl, client, client->name);
else if (res != -EPROTO) {
pw_log_error(NAME" %p: client:%p [%s] error %d (%s)", impl,
client, client->name, res, spa_strerror(res));
return;
}
SPA_FALLTHROUGH;
case -EPROTO:
client_disconnect(client);
client_unref(client);
break;
default:
pw_log_error(NAME" %p: client:%p [%s] error %d (%s)", impl,
client, client->name, res, spa_strerror(res));
break;
}
}
static int check_flatpak(struct client *client, int pid)