chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus: fix hello ioctl buffer size calculation
[elogind.git]
/
src
/
login
/
logind-session.c
diff --git
a/src/login/logind-session.c
b/src/login/logind-session.c
index cd87088456782b07d2b72756ca83a882d03277f4..dc4b3e1621f033a8561e2d76fe345c88905b4c3c 100644
(file)
--- a/
src/login/logind-session.c
+++ b/
src/login/logind-session.c
@@
-40,10
+40,10
@@
#include "bus-error.h"
#include "logind-session.h"
#include "bus-error.h"
#include "logind-session.h"
-static unsigned
devt_hash_func(const void *p
) {
+static unsigned
long devt_hash_func(const void *p, const uint8_t hash_key[HASH_KEY_SIZE]
) {
uint64_t u = *(const dev_t*)p;
uint64_t u = *(const dev_t*)p;
- return uint64_hash_func(&u);
+ return uint64_hash_func(&u
, hash_key
);
}
static int devt_compare_func(const void *_a, const void *_b) {
}
static int devt_compare_func(const void *_a, const void *_b) {
@@
-79,7
+79,7
@@
Session* session_new(Manager *m, const char *id) {
return NULL;
}
return NULL;
}
- s->id =
path_get_file_
name(s->state_file);
+ s->id =
base
name(s->state_file);
if (hashmap_put(m->sessions, s->id, s) < 0) {
hashmap_free(s->devices);
if (hashmap_put(m->sessions, s->id, s) < 0) {
hashmap_free(s->devices);
@@
-334,21
+334,21
@@
int session_load(Session *s) {
s->remote = k;
}
s->remote = k;
}
+ if (vtnr)
+ safe_atou(vtnr, &s->vtnr);
+
if (seat && !s->seat) {
Seat *o;
o = hashmap_get(s->manager->seats, seat);
if (o)
if (seat && !s->seat) {
Seat *o;
o = hashmap_get(s->manager->seats, seat);
if (o)
- seat_attach_session(o, s);
+ r = seat_attach_session(o, s);
+ if (!o || r < 0)
+ log_error("Cannot attach session %s to seat %s", s->id, seat);
}
}
- if (vtnr && s->seat && seat_has_vts(s->seat)) {
- unsigned int v;
-
- k = safe_atou(vtnr, &v);
- if (k >= 0 && v >= 1)
- s->vtnr = v;
- }
+ if (!s->seat || !seat_has_vts(s->seat))
+ s->vtnr = 0;
if (leader) {
k = parse_pid(leader, &s->leader);
if (leader) {
k = parse_pid(leader, &s->leader);
@@
-954,9
+954,6
@@
void session_add_to_gc_queue(Session *s) {
SessionState session_get_state(Session *s) {
assert(s);
SessionState session_get_state(Session *s) {
assert(s);
- if (s->closing)
- return SESSION_CLOSING;
-
if (s->scope_job)
return SESSION_OPENING;
if (s->scope_job)
return SESSION_OPENING;