]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: prefer strjoin() over asprintf()
authorLennart Poettering <lennart@poettering.net>
Mon, 6 Aug 2018 17:05:57 +0000 (19:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 13 Oct 2018 10:59:29 +0000 (12:59 +0200)
src/login/logind-session.c

index a8972303973c6b519ce57e09b237fd736c80a575..32e40bb6217200c21113e0d5c4bddee44c02620a 100644 (file)
@@ -960,7 +960,8 @@ int session_create_fifo(Session *s) {
                 if (r < 0)
                         return r;
 
-                if (asprintf(&s->fifo_path, "/run/systemd/sessions/%s.ref", s->id) < 0)
+                s->fifo_path = strjoin("/run/systemd/sessions/", s->id, ".ref");
+                if (!s->fifo_path)
                         return -ENOMEM;
 
                 if (mkfifo(s->fifo_path, 0600) < 0 && errno != EEXIST)
@@ -972,7 +973,6 @@ int session_create_fifo(Session *s) {
                 s->fifo_fd = open(s->fifo_path, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
                 if (s->fifo_fd < 0)
                         return -errno;
-
         }
 
         if (!s->fifo_event_source) {