X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-session.c;h=0799a98f2428b8eaf8946b273513043e1e1485b6;hp=06ad99e1fec4eaeb6d0488de1bc4e6a0b6ca99b7;hb=a61ff8a1eea921800d6225ff137b24e0a0fb60e1;hpb=c651a8a1445336b303e7ffdbcc9c8a4ef5389a4e diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 06ad99e1f..0799a98f2 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -35,7 +35,7 @@ #include "escape.h" #include "fd-util.h" #include "fileio.h" -#include "formats-util.h" +#include "format-util.h" #include "io-util.h" #include "logind-session.h" #include "mkdir.h" @@ -62,16 +62,13 @@ Session* session_new(Manager *m, const char *id) { return NULL; s->state_file = strappend("/run/systemd/sessions/", id); - if (!s->state_file) { - free(s); - return NULL; - } + if (!s->state_file) + return mfree(s); s->devices = hashmap_new(&devt_hash_ops); if (!s->devices) { free(s->state_file); - free(s); - return NULL; + return mfree(s); } s->id = basename(s->state_file); @@ -79,8 +76,7 @@ Session* session_new(Manager *m, const char *id) { if (hashmap_put(m->sessions, s->id, s) < 0) { hashmap_free(s->devices); free(s->state_file); - free(s); - return NULL; + return mfree(s); } s->manager = m; @@ -516,7 +512,7 @@ static int session_start_scope(Session *s) { char *scope, *job = NULL; const char *description; - scope = strjoin("session-", s->id, ".scope", NULL); + scope = strjoin("session-", s->id, ".scope"); if (!scope) return log_oom(); @@ -643,7 +639,7 @@ static int session_stop_scope(Session *s, bool force) { return 0; /* Let's always abandon the scope first. This tells systemd that we are not interested anymore, and everything - * that is left in in the scope is "left-over". Informing systemd about this has the benefit that it will log + * that is left in the scope is "left-over". Informing systemd about this has the benefit that it will log * when killing any processes left after this point. */ r = manager_abandon_scope(s->manager, s->scope, &error); if (r < 0)