chiark / gitweb /
logind: trivial simplification
[elogind.git] / src / login / logind-seat.c
index 4b99c1869afec0ba67e92d9d1ea4d48fa791c48e..f94d7a22a12aef95209b691de7cf333cabc31d67 100644 (file)
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
 /***
   This file is part of systemd.
 
@@ -29,7 +27,7 @@
 #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"
@@ -50,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;
@@ -370,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