r = mkdir_safe_label("/run/systemd/seats", 0755, 0, 0);
if (r < 0)
r = mkdir_safe_label("/run/systemd/seats", 0755, 0, 0);
if (r < 0)
static int vt_allocate(unsigned int vtnr) {
char p[sizeof("/dev/tty") + DECIMAL_STR_MAX(unsigned int)];
_cleanup_close_ int fd = -1;
assert(vtnr >= 1);
static int vt_allocate(unsigned int vtnr) {
char p[sizeof("/dev/tty") + DECIMAL_STR_MAX(unsigned int)];
_cleanup_close_ int fd = -1;
assert(vtnr >= 1);
int seat_switch_to(Seat *s, unsigned int num) {
/* Public session positions skip 0 (there is only F1-F12). Maybe it
* will get reassigned in the future, so return error for now. */
int seat_switch_to(Seat *s, unsigned int num) {
/* Public session positions skip 0 (there is only F1-F12). Maybe it
* will get reassigned in the future, so return error for now. */
return;
if (pos < s->position_count && s->positions[pos] == session) {
s->positions[pos] = NULL;
/* There might be another session claiming the same
return;
if (pos < s->position_count && s->positions[pos] == session) {
s->positions[pos] = NULL;
/* There might be another session claiming the same
* for it and set it on the free slot. */
LIST_FOREACH(sessions_by_seat, iter, s->sessions) {
* for it and set it on the free slot. */
LIST_FOREACH(sessions_by_seat, iter, s->sessions) {
s->positions[pos] = session;
}
static void seat_assign_position(Seat *s, Session *session) {
unsigned int pos;
s->positions[pos] = session;
}
static void seat_assign_position(Seat *s, Session *session) {
unsigned int pos;