chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Compiling.
[elogind.git]
/
src
/
login
/
logind-button.c
diff --git
a/src/login/logind-button.c
b/src/login/logind-button.c
index 1afb01fc6838db375eb5933081e9e7b083f67ded..610adc513e0c6c5f5960bb03baf31d8793907bf3 100644
(file)
--- a/
src/login/logind-button.c
+++ b/
src/login/logind-button.c
@@
-19,7
+19,6
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
@@
-28,9
+27,7
@@
#include <linux/input.h>
#include "sd-messages.h"
#include <linux/input.h>
#include "sd-messages.h"
-#include "conf-parser.h"
#include "util.h"
#include "util.h"
-#include "special.h"
#include "logind-button.h"
Button* button_new(Manager *m, const char *name) {
#include "logind-button.h"
Button* button_new(Manager *m, const char *name) {
@@
-247,13
+244,11
@@
int button_open(Button *b) {
b->fd = -1;
}
b->fd = -1;
}
- p = str
append
a("/dev/input/", b->name);
+ p = str
join
a("/dev/input/", b->name);
b->fd = open(p, O_RDWR|O_CLOEXEC|O_NOCTTY|O_NONBLOCK);
b->fd = open(p, O_RDWR|O_CLOEXEC|O_NOCTTY|O_NONBLOCK);
- if (b->fd < 0) {
- log_warning_errno(errno, "Failed to open %s: %m", b->name);
- return -errno;
- }
+ if (b->fd < 0)
+ return log_warning_errno(errno, "Failed to open %s: %m", b->name);
if (ioctl(b->fd, EVIOCGNAME(sizeof(name)), name) < 0) {
log_error_errno(errno, "Failed to get input name: %m");
if (ioctl(b->fd, EVIOCGNAME(sizeof(name)), name) < 0) {
log_error_errno(errno, "Failed to get input name: %m");