diff options
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) { |