chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unit-name: style fix in unit_name_is_template()
[elogind.git]
/
src
/
login
/
logind-seat.c
diff --git
a/src/login/logind-seat.c
b/src/login/logind-seat.c
index 1bae6f6e0780fb877ccdd64e72c6e6c6ad9279c4..045712192a35e0feecb9ff5044de1759aae2480a 100644
(file)
--- a/
src/login/logind-seat.c
+++ b/
src/login/logind-seat.c
@@
-31,6
+31,7
@@
#include "logind-acl.h"
#include "util.h"
#include "mkdir.h"
#include "logind-acl.h"
#include "util.h"
#include "mkdir.h"
+#include "path-util.h"
Seat *seat_new(Manager *m, const char *id) {
Seat *s;
Seat *seat_new(Manager *m, const char *id) {
Seat *s;
@@
-48,7
+49,7
@@
Seat *seat_new(Manager *m, const char *id) {
return NULL;
}
return NULL;
}
- s->id =
file_name_from_path
(s->state_file);
+ s->id =
path_get_file_name
(s->state_file);
s->manager = m;
if (hashmap_put(m->seats, s->id, s) < 0) {
s->manager = m;
if (hashmap_put(m->seats, s->id, s) < 0) {
@@
-90,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;
@@
-103,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);
@@
-426,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;