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; return;
error: error:
if (res == -EPIPE) switch (res) {
pw_log_info(NAME" %p: client:%p [%s] disconnected", impl, client, client->name); case -EPIPE:
else if (res != -EPROTO) { pw_log_info(NAME" %p: client:%p [%s] disconnected", impl, client, client->name);
pw_log_error(NAME" %p: client:%p [%s] error %d (%s)", impl, SPA_FALLTHROUGH;
client, client->name, res, spa_strerror(res)); case -EPROTO:
return; 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;
} }
client_disconnect(client);
client_unref(client);
} }
static int check_flatpak(struct client *client, int pid) static int check_flatpak(struct client *client, int pid)