chiark / gitweb /
Introduce udev object cleanup functions
[elogind.git] / src / login / logind-session.c
index eea0bfb85b796608a60d4977f3dc2f9a1e8094ca..27aa33514232d67131d8b49040f05a8e508f5e7b 100644 (file)
 #include "dbus-common.h"
 #include "logind-session.h"
 
+static unsigned devt_hash_func(const void *p) {
+        uint64_t u = *(const dev_t*)p;
+
+        return uint64_hash_func(&u);
+}
+
+static int devt_compare_func(const void *_a, const void *_b) {
+        dev_t a, b;
+
+        a = *(const dev_t*) _a;
+        b = *(const dev_t*) _b;
+
+        return a < b ? -1 : (a > b ? 1 : 0);
+}
+
 Session* session_new(Manager *m, const char *id) {
         Session *s;
 
@@ -53,7 +68,7 @@ Session* session_new(Manager *m, const char *id) {
                 return NULL;
         }
 
-        s->devices = hashmap_new(trivial_hash_func, trivial_compare_func);
+        s->devices = hashmap_new(devt_hash_func, devt_compare_func);
         if (!s->devices) {
                 free(s->state_file);
                 free(s);
@@ -244,7 +259,6 @@ int session_load(Session *s) {
                 *seat = NULL,
                 *vtnr = NULL,
                 *leader = NULL,
-                *audit_id = NULL,
                 *type = NULL,
                 *class = NULL,
                 *uid = NULL,