aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-03-01 18:10:38 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-03-01 18:10:38 +0100
commitd6b7c594b70ed0429a25ac60fae534cbd892764e (patch)
tree48721ce0d287350c9f07fc5b4b9c61bf7a3fa6f0
parent799c57b3e34bcac59760a64d01253ab362006f88 (diff)
downloadfbida-d6b7c594b70ed0429a25ac60fae534cbd892764e.tar.gz
more ligind logging
-rw-r--r--kbd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kbd.c b/kbd.c
index 9be8052..bcffe02 100644
--- a/kbd.c
+++ b/kbd.c
@@ -246,7 +246,7 @@ int logind_open(const char *path)
sd_bus_message *m = NULL;
struct stat st;
unsigned int maj, min;
- bool unused;
+ bool inactive;
int handle, fd, r;
r = stat(path, &st);
@@ -273,15 +273,17 @@ int logind_open(const char *path)
return -1;
}
- r = sd_bus_message_read(m, "hb", &handle, &unused);
+ r = sd_bus_message_read(m, "hb", &handle, &inactive);
if (r < 0) {
- fprintf(stderr, "Parse TakeDevice reply failed: %s\n", strerror(-r));
+ fprintf(stderr, "Parsing TakeDevice reply failed: %s\n", strerror(-r));
fd = -1;
+ } else {
+ fd = dup(handle);
}
- fd = dup(handle);
sd_bus_message_unref(m);
- fprintf(stderr, "open %s: got fd %d via logind.\n", path, fd);
+ fprintf(stderr, "open %s: got fd %d via logind (handle %d, inactive %s).\n",
+ path, fd, handle, inactive ? "true" : "false");
return fd;
}