static void session_remove_fifo(Session *s);
-static unsigned long devt_hash_func(const void *p, const uint8_t hash_key[HASH_KEY_SIZE]) {
- uint64_t u = *(const dev_t*)p;
-
- return uint64_hash_func(&u, hash_key);
-}
-
-static int devt_compare_func(const void *_a, const void *_b) {
- dev_t a, b;
-
- a = *(const dev_t*) _a;
- b = *(const dev_t*) _b;
-
- return a < b ? -1 : (a > b ? 1 : 0);
-}
-
Session* session_new(Manager *m, const char *id) {
Session *s;
hashmap_remove(s->manager->sessions, s->id);
- s->vt_source = sd_event_source_unref(s->vt_source);
-
free(s->state_file);
free(s);
}
return s->vtfd;
}
-static int session_vt_fn(sd_event_source *source, const struct signalfd_siginfo *si, void *data) {
- Session *s = data;
-
- if (s->vtfd >= 0)
- ioctl(s->vtfd, VT_RELDISP, 1);
-
- return 0;
-}
-
int session_prepare_vt(Session *s) {
int vt, r;
struct vt_mode mode = { 0 };
- sigset_t mask;
if (s->vtnr < 1)
return 0;
goto error;
}
- sigemptyset(&mask);
- sigaddset(&mask, SIGUSR1);
- sigprocmask(SIG_BLOCK, &mask, NULL);
-
- r = sd_event_add_signal(s->manager->event, &s->vt_source, SIGUSR1, session_vt_fn, s);
- if (r < 0)
- goto error;
-
/* Oh, thanks to the VT layer, VT_AUTO does not work with KD_GRAPHICS.
* So we need a dummy handler here which just acknowledges *all* VT
* switch requests. */
mode.mode = VT_PROCESS;
- mode.relsig = SIGUSR1;
- mode.acqsig = SIGUSR1;
+ mode.relsig = SIGRTMIN;
+ mode.acqsig = SIGRTMIN + 1;
r = ioctl(vt, VT_SETMODE, &mode);
if (r < 0) {
r = -errno;
if (vt < 0)
return;
- s->vt_source = sd_event_source_unref(s->vt_source);
-
ioctl(vt, KDSETMODE, KD_TEXT);
if (read_one_line_file("/sys/module/vt/parameters/default_utf8", &utf8) >= 0 && *utf8 == '1')
[SESSION_X11] = "x11",
[SESSION_WAYLAND] = "wayland",
[SESSION_MIR] = "mir",
+ [SESSION_WEB] = "web",
};
DEFINE_STRING_TABLE_LOOKUP(session_type, SessionType);