#include "process-util.h"
#include "strv.h"
#include "terminal-util.h"
+#include "udev-util.h"
#include "user-util.h"
void manager_reset_config(Manager *m) {
}
int manager_process_seat_device(Manager *m, sd_device *d) {
- const char *action;
Device *device;
int r;
assert(m);
- if (sd_device_get_property_value(d, "ACTION", &action) >= 0 &&
- streq(action, "remove")) {
+ if (device_for_action(d, DEVICE_ACTION_REMOVE)) {
const char *syspath;
r = sd_device_get_syspath(d, &syspath);
}
int manager_process_button_device(Manager *m, sd_device *d) {
- const char *action, *sysname;
+ const char *sysname;
Button *b;
int r;
if (r < 0)
return r;
- if (sd_device_get_property_value(d, "ACTION", &action) >= 0 &&
- streq(action, "remove")) {
+ if (device_for_action(d, DEVICE_ACTION_REMOVE)) {
b = hashmap_get(m->buttons, sysname);
if (!b)
#include "signal-util.h"
#include "strv.h"
#include "terminal-util.h"
+#include "udev-util.h"
static Manager* manager_unref(Manager *m);
DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_unref);
static int manager_dispatch_vcsa_udev(sd_device_monitor *monitor, sd_device *device, void *userdata) {
Manager *m = userdata;
- const char *name, *action;
+ const char *name;
assert(m);
assert(device);
if (sd_device_get_sysname(device, &name) >= 0 &&
startswith(name, "vcsa") &&
- sd_device_get_property_value(device, "ACTION", &action) >= 0 &&
- streq(action, "remove"))
+ device_for_action(device, DEVICE_ACTION_REMOVE))
seat_preallocate_vts(m->seat0);
return 0;