return q;
}
+
+int vt_release(int fd, bool restore) {
+ assert(fd >= 0);
+
+ /* This function releases the VT by acknowledging the VT-switch signal
+ * sent by the kernel and optionally reset the VT in text and auto
+ * VT-switching modes. */
+
+ if (ioctl(fd, VT_RELDISP, 1) < 0)
+ return -errno;
+
+ if (restore)
+ return vt_restore(fd);
+
+ return 0;
+}
return;
session_device_pause_all(s);
- r = ioctl(s->vtfd, VT_RELDISP, 1);
+ r = vt_release(s->vtfd, false);
if (r < 0)
- log_debug_errno(errno, "Cannot release VT of session %s: %m", s->id);
+ log_debug_errno(r, "Cannot release VT of session %s: %m", s->id);
}
bool session_is_controller(Session *s, const char *sender) {