chiark / gitweb /
logind: trivial simplification
[elogind.git] / src / login / logind-seat.c
index 33fd3afacae4ff38af25d10fc71fa4205dc4cbdc..f94d7a22a12aef95209b691de7cf333cabc31d67 100644 (file)
@@ -27,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"
@@ -48,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;
@@ -368,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