chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
journal: rotate busy files away when we try to write to them
[elogind.git]
/
src
/
login
/
logind-seat.c
diff --git
a/src/login/logind-seat.c
b/src/login/logind-seat.c
index 06debf887a0da77d802d43c4c35dbd8914fa3efd..045712192a35e0feecb9ff5044de1759aae2480a 100644
(file)
--- a/
src/login/logind-seat.c
+++ b/
src/login/logind-seat.c
@@
-91,7
+91,7
@@
int seat_save(Seat *s) {
if (!s->started)
return 0;
if (!s->started)
return 0;
- r =
safe_mkdir
("/run/systemd/seats", 0755, 0, 0);
+ r =
mkdir_safe_label
("/run/systemd/seats", 0755, 0, 0);
if (r < 0)
goto finish;
if (r < 0)
goto finish;
@@
-104,9
+104,13
@@
int seat_save(Seat *s) {
fprintf(f,
"# This is private data. Do not parse.\n"
"IS_VTCONSOLE=%i\n"
fprintf(f,
"# This is private data. Do not parse.\n"
"IS_VTCONSOLE=%i\n"
- "CAN_MULTI_SESSION=%i\n",
+ "CAN_MULTI_SESSION=%i\n"
+ "CAN_TTY=%i\n"
+ "CAN_GRAPHICAL=%i\n",
seat_is_vtconsole(s),
seat_is_vtconsole(s),
- seat_can_multi_session(s));
+ seat_can_multi_session(s),
+ seat_can_tty(s),
+ seat_can_graphical(s));
if (s->active) {
assert(s->active->user);
if (s->active) {
assert(s->active->user);
@@
-427,6
+431,18
@@
bool seat_can_multi_session(Seat *s) {
return s->manager->console_active_fd >= 0;
}
return s->manager->console_active_fd >= 0;
}
+bool seat_can_tty(Seat *s) {
+ assert(s);
+
+ return seat_is_vtconsole(s);
+}
+
+bool seat_can_graphical(Seat *s) {
+ assert(s);
+
+ return !!s->devices;
+}
+
int seat_get_idle_hint(Seat *s, dual_timestamp *t) {
Session *session;
bool idle_hint = true;
int seat_get_idle_hint(Seat *s, dual_timestamp *t) {
Session *session;
bool idle_hint = true;