summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-event.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev/udev-event.h')
-rw-r--r--src/udev/udev-event.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/udev/udev-event.h b/src/udev/udev-event.h
index 6b94fd0..3dc8936 100644
--- a/src/udev/udev-event.h
+++ b/src/udev/udev-event.h
@@ -15,9 +15,21 @@
#include "macro.h"
#include "time-util.h"
#include "udev-rules.h"
+#include "udev-worker.h"
#include "user-util.h"
+typedef enum EventMode {
+ EVENT_UDEV_WORKER,
+ EVENT_UDEVADM_TEST,
+ EVENT_UDEVADM_TEST_BUILTIN,
+ EVENT_TEST_RULE_RUNNER,
+ EVENT_TEST_SPAWN,
+} EventMode;
+
typedef struct UdevEvent {
+ UdevWorker *worker;
+ sd_netlink *rtnl;
+
sd_device *dev;
sd_device *dev_parent;
sd_device *dev_db_clone;
@@ -29,9 +41,7 @@ typedef struct UdevEvent {
gid_t gid;
OrderedHashmap *seclabel_list;
OrderedHashmap *run_list;
- usec_t exec_delay_usec;
usec_t birth_usec;
- sd_netlink *rtnl;
unsigned builtin_run;
unsigned builtin_ret;
UdevRuleEscapeType esc:8;
@@ -45,16 +55,16 @@ typedef struct UdevEvent {
bool run_final;
bool log_level_was_debug;
int default_log_level;
+ EventMode event_mode;
} UdevEvent;
-UdevEvent *udev_event_new(sd_device *dev, usec_t exec_delay_usec, sd_netlink *rtnl, int log_level);
+UdevEvent *udev_event_new(sd_device *dev, UdevWorker *worker, EventMode mode);
UdevEvent *udev_event_free(UdevEvent *event);
DEFINE_TRIVIAL_CLEANUP_FUNC(UdevEvent*, udev_event_free);
-int udev_event_execute_rules(
- UdevEvent *event,
- int inotify_fd,
- usec_t timeout_usec,
- int timeout_signal,
- Hashmap *properties_list,
- UdevRules *rules);
+int udev_event_execute_rules(UdevEvent *event, UdevRules *rules);
+
+static inline bool EVENT_MODE_DESTRUCTIVE(UdevEvent *event) {
+ assert(event);
+ return IN_SET(event->event_mode, EVENT_UDEV_WORKER, EVENT_TEST_RULE_RUNNER);
+}