X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-seat.c;h=f94d7a22a12aef95209b691de7cf333cabc31d67;hb=a5c28308446550e0966825472babdf123fc976ac;hp=813ab153e62b94e303ea0d70540560cefa49b45e;hpb=4084669c7f802c9745bcb6bed77bdaf49ffd896d;p=elogind.git diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c index 813ab153e..f94d7a22a 100644 --- a/src/login/logind-seat.c +++ b/src/login/logind-seat.c @@ -1,5 +1,3 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - /*** This file is part of systemd. @@ -29,11 +27,12 @@ #include "alloc-util.h" #include "fd-util.h" #include "fileio.h" -#include "formats-util.h" +#include "format-util.h" #include "logind-acl.h" #include "logind-seat.h" #include "mkdir.h" #include "parse-util.h" +#include "stdio-util.h" #include "string-util.h" #include "terminal-util.h" #include "util.h" @@ -49,18 +48,15 @@ Seat *seat_new(Manager *m, const char *id) { return NULL; s->state_file = strappend("/run/systemd/seats/", id); - if (!s->state_file) { - free(s); - return NULL; - } + if (!s->state_file) + return mfree(s); s->id = basename(s->state_file); s->manager = m; if (hashmap_put(m->seats, s->id, s) < 0) { free(s->state_file); - free(s); - return NULL; + return mfree(s); } return s; @@ -182,7 +178,7 @@ static int vt_allocate(unsigned int vtnr) { assert(vtnr >= 1); - snprintf(p, sizeof(p), "/dev/tty%u", vtnr); + xsprintf(p, "/dev/tty%u", vtnr); fd = open_terminal(p, O_RDWR|O_NOCTTY|O_CLOEXEC); if (fd < 0) return -errno; @@ -369,7 +365,6 @@ int seat_active_vt_changed(Seat *s, unsigned int vtnr) { } r = seat_set_active(s, new_active); - #if 0 /// elogind does not spawn autovt manager_spawn_autovt(s->manager, vtnr); #endif // 0