chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tmpfiles: always recreate the most basic directory structure in /var
[elogind.git]
/
src
/
login
/
logind-seat.c
diff --git
a/src/login/logind-seat.c
b/src/login/logind-seat.c
index 96cf08e3b2f1b34fc6d2dc7d0ef2b44a85a94802..3114de84de5811950248486d1a02862f29eb7fb1 100644
(file)
--- a/
src/login/logind-seat.c
+++ b/
src/login/logind-seat.c
@@
-120,9
+120,9
@@
int seat_save(Seat *s) {
fprintf(f,
"ACTIVE=%s\n"
fprintf(f,
"ACTIVE=%s\n"
- "ACTIVE_UID=
%lu
\n",
+ "ACTIVE_UID=
"UID_FMT"
\n",
s->active->id,
s->active->id,
-
(unsigned long)
s->active->user->uid);
+ s->active->user->uid);
}
if (s->sessions) {
}
if (s->sessions) {
@@
-168,14
+168,12
@@
int seat_load(Seat *s) {
}
static int vt_allocate(unsigned int vtnr) {
}
static int vt_allocate(unsigned int vtnr) {
-
_cleanup_free_ char *p = NULL
;
+
char p[sizeof("/dev/tty") + DECIMAL_STR_MAX(unsigned int)]
;
_cleanup_close_ int fd = -1;
assert(vtnr >= 1);
_cleanup_close_ int fd = -1;
assert(vtnr >= 1);
- if (asprintf(&p, "/dev/tty%u", vtnr) < 0)
- return -ENOMEM;
-
+ snprintf(p, sizeof(p), "/dev/tty%u", vtnr);
fd = open_terminal(p, O_RDWR|O_NOCTTY|O_CLOEXEC);
if (fd < 0)
return -errno;
fd = open_terminal(p, O_RDWR|O_NOCTTY|O_CLOEXEC);
if (fd < 0)
return -errno;
@@
-487,7
+485,7
@@
void seat_claim_position(Seat *s, Session *session, unsigned int pos) {
if (seat_has_vts(s))
pos = session->vtnr;
if (seat_has_vts(s))
pos = session->vtnr;
- if (!GREEDY_REALLOC0
_T
(s->positions, s->position_count, pos + 1))
+ if (!GREEDY_REALLOC0(s->positions, s->position_count, pos + 1))
return;
seat_evict_position(s, session);
return;
seat_evict_position(s, session);