1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 16:59:03 +03:00

logind: let's reduce one level of indentation

This commit is contained in:
Lennart Poettering 2018-02-26 18:33:20 +01:00
parent e38aa66426
commit d7ba71f4b4

View File

@ -455,7 +455,9 @@ void session_device_resume_all(Session *s) {
assert(s); assert(s);
HASHMAP_FOREACH(sd, s->devices, i) { HASHMAP_FOREACH(sd, s->devices, i) {
if (!sd->active) { if (sd->active)
continue;
if (session_device_start(sd) < 0) if (session_device_start(sd) < 0)
continue; continue;
if (session_device_save(sd) < 0) if (session_device_save(sd) < 0)
@ -463,7 +465,6 @@ void session_device_resume_all(Session *s) {
session_device_notify(sd, SESSION_DEVICE_RESUME); session_device_notify(sd, SESSION_DEVICE_RESUME);
} }
} }
}
void session_device_pause_all(Session *s) { void session_device_pause_all(Session *s) {
SessionDevice *sd; SessionDevice *sd;
@ -472,25 +473,27 @@ void session_device_pause_all(Session *s) {
assert(s); assert(s);
HASHMAP_FOREACH(sd, s->devices, i) { HASHMAP_FOREACH(sd, s->devices, i) {
if (sd->active) { if (!sd->active)
continue;
session_device_stop(sd); session_device_stop(sd);
session_device_notify(sd, SESSION_DEVICE_PAUSE); session_device_notify(sd, SESSION_DEVICE_PAUSE);
} }
} }
}
unsigned int session_device_try_pause_all(Session *s) { unsigned int session_device_try_pause_all(Session *s) {
unsigned num_pending = 0;
SessionDevice *sd; SessionDevice *sd;
Iterator i; Iterator i;
unsigned int num_pending = 0;
assert(s); assert(s);
HASHMAP_FOREACH(sd, s->devices, i) { HASHMAP_FOREACH(sd, s->devices, i) {
if (sd->active) { if (!sd->active)
continue;
session_device_notify(sd, SESSION_DEVICE_TRY_PAUSE); session_device_notify(sd, SESSION_DEVICE_TRY_PAUSE);
++num_pending; num_pending++;
}
} }
return num_pending; return num_pending;