diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-03-01 18:10:38 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-03-01 18:10:38 +0100 |
commit | d6b7c594b70ed0429a25ac60fae534cbd892764e (patch) | |
tree | 48721ce0d287350c9f07fc5b4b9c61bf7a3fa6f0 | |
parent | 799c57b3e34bcac59760a64d01253ab362006f88 (diff) | |
download | fbida-d6b7c594b70ed0429a25ac60fae534cbd892764e.tar.gz |
more ligind logging
-rw-r--r-- | kbd.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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; } |