chiark / gitweb /
fstab-generator: ignore invalid swap priority
[elogind.git] / src / test / test-udev.c
index f2283ec7a784b46d634af2f15919e8dcaa05aef4..23b7faa93923089b4742a4b5870432bfc96ebbcd 100644 (file)
 ***/
 
 #include <stdio.h>
-#include <stddef.h>
 #include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <ctype.h>
 #include <errno.h>
 #include <unistd.h>
-#include <grp.h>
 #include <sched.h>
 #include <sys/mount.h>
 #include <sys/signalfd.h>
 
 #include "missing.h"
+#include "selinux-util.h"
 #include "udev.h"
 #include "udev-util.h"
 
@@ -114,13 +110,12 @@ int main(int argc, char *argv[]) {
         rules = udev_rules_new(udev, 1);
 
         strscpyl(syspath, sizeof(syspath), "/sys", devpath, NULL);
-        dev = udev_device_new_from_syspath(udev, syspath);
+        dev = udev_device_new_from_synthetic_event(udev, syspath, action);
         if (dev == NULL) {
                 log_debug("unknown device '%s'", devpath);
                 goto out;
         }
 
-        udev_device_set_action(dev, action);
         event = udev_event_new(dev);
 
         sigfillset(&mask);