mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
logind: prefer strjoin() over asprintf()
This commit is contained in:
parent
709d058756
commit
d5ddc93015
@ -960,7 +960,8 @@ int session_create_fifo(Session *s) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
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;
|
return -ENOMEM;
|
||||||
|
|
||||||
if (mkfifo(s->fifo_path, 0600) < 0 && errno != EEXIST)
|
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);
|
s->fifo_fd = open(s->fifo_path, O_RDONLY|O_CLOEXEC|O_NONBLOCK);
|
||||||
if (s->fifo_fd < 0)
|
if (s->fifo_fd < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!s->fifo_event_source) {
|
if (!s->fifo_event_source) {
|
||||||
|
Loading…
Reference in New Issue
Block a user