summaryrefslogtreecommitdiff
path: root/src/login/logind-seat.c
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2018-03-13 19:14:05 +0100
committerSven Eden <yamakuzure@gmx.net>2018-03-26 18:25:59 +0200
commit969056d0e1de27ab99946632849b6f965e51f753 (patch)
tree30a03c74c55ac73d92f35d8d1f60a311cb616575 /src/login/logind-seat.c
parent36fdbc812fbd4cfd9a4c5471107a93bab04b306c (diff)
Prep v236 : Add missing SPDX-License-Identifier (5/9) src/login
Diffstat (limited to 'src/login/logind-seat.c')
-rw-r--r--src/login/logind-seat.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index eacea3c39..0301d670a 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
@@ -19,6 +20,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <stdio_ext.h>
#include <string.h>
#include <unistd.h>
@@ -93,7 +95,7 @@ int seat_save(Seat *s) {
if (!s->started)
return 0;
- r = mkdir_safe_label("/run/systemd/seats", 0755, 0, 0);
+ r = mkdir_safe_label("/run/elogind/seats", 0755, 0, 0, false);
if (r < 0)
goto fail;
@@ -101,7 +103,8 @@ int seat_save(Seat *s) {
if (r < 0)
goto fail;
- fchmod(fileno(f), 0644);
+ (void) __fsetlocking(f, FSETLOCKING_BYCALLER);
+ (void) fchmod(fileno(f), 0644);
fprintf(f,
"# This is private data. Do not parse.\n"
@@ -127,7 +130,7 @@ int seat_save(Seat *s) {
if (s->sessions) {
Session *i;
- fputs_unlocked("SESSIONS=", f);
+ fputs("SESSIONS=", f);
LIST_FOREACH(sessions_by_seat, i, s->sessions) {
fprintf(f,
"%s%c",
@@ -135,7 +138,7 @@ int seat_save(Seat *s) {
i->sessions_by_seat_next ? ' ' : '\n');
}
- fputs_unlocked("UIDS=", f);
+ fputs("UIDS=", f);
LIST_FOREACH(sessions_by_seat, i, s->sessions)
fprintf(f,
UID_FMT"%c",