logind: prefer strjoin() over asprintf()

This commit is contained in:
Lennart Poettering 2018-08-06 19:05:57 +02:00
parent 709d058756
commit d5ddc93015
1 changed files with 2 additions and 2 deletions

View 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) {