]> git.proxmox.com Git - systemd.git/blobdiff - src/login/logind-button.c
New upstream version 240
[systemd.git] / src / login / logind-button.c
index 0defa6b9ba9f0ac5054e709d87e851acb61dfde3..daffbf0668cd397af469146e2a0ab388a69213f0 100644 (file)
@@ -12,6 +12,7 @@
 #include "alloc-util.h"
 #include "fd-util.h"
 #include "logind-button.h"
+#include "missing_input.h"
 #include "string-util.h"
 #include "util.h"
 
@@ -329,10 +330,10 @@ int button_open(Button *b) {
         r = button_suitable(b);
         if (r < 0)
                 return log_warning_errno(r, "Failed to determine whether input device is relevant to us: %m");
-        if (r == 0) {
-                log_debug("Device %s does not expose keys or switches relevant to us, ignoring.", p);
-                return -EADDRNOTAVAIL;
-        }
+        if (r == 0)
+                return log_debug_errno(SYNTHETIC_ERRNO(EADDRNOTAVAIL),
+                                       "Device %s does not expose keys or switches relevant to us, ignoring.",
+                                       p);
 
         if (ioctl(b->fd, EVIOCGNAME(sizeof(name)), name) < 0) {
                 r = log_error_errno(errno, "Failed to get input name: %m");