]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/login/logind-button.c
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / login / logind-button.c
index 39749925c5ae3bd53fd5dd88ce497bc3ddfdb60a..daffbf0668cd397af469146e2a0ab388a69213f0 100644 (file)
@@ -1,9 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2012 Lennart Poettering
-***/
 
 #include <errno.h>
 #include <fcntl.h>
@@ -17,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"
 
@@ -334,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");