chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
logind: apply selinux label to XDG_RUNTIME_DIR
[elogind.git]
/
src
/
login
/
logind-button.c
diff --git
a/src/login/logind-button.c
b/src/login/logind-button.c
index e22b106b3c0276052a7e05fcff46db10c1c66ed5..210b889c4f987cd7998b38ac69e0578c77e98603 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) {
@@
-73,7
+70,7
@@
void button_free(Button *b) {
/* If the device has been unplugged close() returns
* ENODEV, let's ignore this, hence we don't use
* safe_close() */
/* If the device has been unplugged close() returns
* ENODEV, let's ignore this, hence we don't use
* safe_close() */
- close(b->fd);
+
(void)
close(b->fd);
}
free(b->name);
}
free(b->name);
@@
-103,7
+100,7
@@
static void button_lid_switch_handle_action(Manager *manager, bool is_edge) {
assert(manager);
/* If we are docked, handle the lid switch differently */
assert(manager);
/* If we are docked, handle the lid switch differently */
- if (manager_is_docked_or_
multiple
_displays(manager))
+ if (manager_is_docked_or_
external
_displays(manager))
handle_action = manager->handle_lid_switch_docked;
else
handle_action = manager->handle_lid_switch;
handle_action = manager->handle_lid_switch_docked;
else
handle_action = manager->handle_lid_switch;
@@
-247,7
+244,7
@@
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);
if (b->fd < 0)
b->fd = open(p, O_RDWR|O_CLOEXEC|O_NOCTTY|O_NONBLOCK);
if (b->fd < 0)