diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 18:23:20 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 18:24:30 +0100 |
commit | 23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 (patch) | |
tree | 28e66fb86dd0cffc3a3cca3cf234cb52c3b64ad3 /src/libsystemd-terminal/modeset.c | |
parent | 5e03c6e3b517286bbd65b48d88f60e5b83721894 (diff) |
treewide: more log_*_errno + return simplifications
Diffstat (limited to 'src/libsystemd-terminal/modeset.c')
-rw-r--r-- | src/libsystemd-terminal/modeset.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/libsystemd-terminal/modeset.c b/src/libsystemd-terminal/modeset.c index 54faec8fee..0b6499b18f 100644 --- a/src/libsystemd-terminal/modeset.c +++ b/src/libsystemd-terminal/modeset.c @@ -146,16 +146,12 @@ static int modeset_new(Modeset **out) { return log_oom(); r = sd_pid_get_session(getpid(), &m->session); - if (r < 0) { - log_error_errno(r, "Cannot retrieve logind session: %m"); - return r; - } + if (r < 0) + return log_error_errno(r, "Cannot retrieve logind session: %m"); r = sd_session_get_seat(m->session, &m->seat); - if (r < 0) { - log_error_errno(r, "Cannot retrieve seat of logind session: %m"); - return r; - } + if (r < 0) + return log_error_errno(r, "Cannot retrieve seat of logind session: %m"); m->my_tty = is_my_tty(m->session); m->managed = m->my_tty && geteuid() > 0; @@ -309,17 +305,13 @@ static int modeset_sysview_fn(sysview_context *c, void *userdata, sysview_event name, modeset_grdev_fn, m); - if (r < 0) { - log_error_errno(r, "Cannot create grdev session: %m"); - return r; - } + if (r < 0) + return log_error_errno(r, "Cannot create grdev session: %m"); if (m->managed) { r = sysview_session_take_control(ev->session_add.session); - if (r < 0) { - log_error_errno(r, "Cannot request session control: %m"); - return r; - } + if (r < 0) + return log_error_errno(r, "Cannot request session control: %m"); } grdev_session_enable(m->grdev_session); @@ -358,10 +350,8 @@ static int modeset_sysview_fn(sysview_context *c, void *userdata, sysview_event break; case SYSVIEW_EVENT_SESSION_CONTROL: r = ev->session_control.error; - if (r < 0) { - log_error_errno(r, "Cannot acquire session control: %m"); - return r; - } + if (r < 0) + return log_error_errno(r, "Cannot acquire session control: %m"); r = ioctl(1, KDSKBMODE, K_UNICODE); if (r < 0) { |