diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-09-23 13:33:53 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-09-23 20:05:44 +0200 |
commit | ce540a24d53e1751a5b69224d5a7f5a59f2de7ad (patch) | |
tree | 994109f483d2232e29423e671eed1ae49cf3a04e /src/login | |
parent | 590889ac53c8557493f491b4259669e54074615d (diff) |
Silence some "unchecked return-value" warnings
This adds some log-messages to ioctl() calls where we don't really care
for the return value. It isn't strictly necessary to look for those, but
lets be sure and print warnings. This silences gcc and coverity, and also
makes sure we get reports in case something goes wrong and we didn't
expect it to fail that way.
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-session.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 477ac9ab1b..65bbb77750 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -1054,6 +1054,8 @@ void session_restore_vt(Session *s) { } void session_leave_vt(Session *s) { + int r; + assert(s); /* This is called whenever we get a VT-switch signal from the kernel. @@ -1071,7 +1073,9 @@ void session_leave_vt(Session *s) { return; session_device_pause_all(s); - ioctl(s->vtfd, VT_RELDISP, 1); + r = ioctl(s->vtfd, VT_RELDISP, 1); + if (r < 0) + log_debug("Cannot release VT of session %s: %m", s->id); } bool session_is_controller(Session *s, const char *sender) { |