]> err.no Git - systemd/commitdiff
remove UDEV_RUN environment variable
authorKay Sievers <kay.sievers@vrfy.org>
Fri, 25 Dec 2009 14:23:45 +0000 (15:23 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Fri, 25 Dec 2009 14:23:45 +0000 (15:23 +0100)
It handles only RUN but not IMPORT and PROGRAM. There is no sane way
to suppress program execution. Most important programs run with IMPORT
these days. Also events can no longer suppressed with the libudev
netlink messages, so UDEV_RUN does nothing useful and is just
inconsistent.

Makefile.am
libudev/libudev-private.h
libudev/libudev.c
udev/test-udev.c
udev/udevadm-test.c
udev/udevd.c

index 126064b631a487bcb7dcf244d9bddc8f388e2f99..e037e607d4867d9163bd62bc5c05f6fc8732b041 100644 (file)
@@ -28,9 +28,9 @@ CLEANFILES =
 # ------------------------------------------------------------------------------
 # libudev
 # ------------------------------------------------------------------------------
-LIBUDEV_CURRENT=5
-LIBUDEV_REVISION=2
-LIBUDEV_AGE=5
+LIBUDEV_CURRENT=6
+LIBUDEV_REVISION=0
+LIBUDEV_AGE=6
 
 SUBDIRS += libudev/docs
 
index fe1575d60b27c149f7dc0f1e9cece391b1ba9455..c2fff0021115e874c21ba334a82f8c3c336abe06 100644 (file)
@@ -59,7 +59,6 @@ void udev_log(struct udev *udev,
              const char *format, ...)
              __attribute__((format(printf, 6, 7)));
 const char *udev_get_rules_path(struct udev *udev);
-int udev_get_run(struct udev *udev);
 struct udev_list_entry *udev_add_property(struct udev *udev, const char *key, const char *value);
 struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev);
 
index 190913871ea9b0ff5671010e1650bfec212ab11e..411e9aec8b5f12336a4125ce7fb7de85ffb8e708 100644 (file)
@@ -45,7 +45,6 @@ struct udev {
        char *rules_path;
        struct udev_list_node properties_list;
        int log_priority;
-       int run;
 };
 
 void udev_log(struct udev *udev,
@@ -122,7 +121,6 @@ struct udev *udev_new(void)
        udev->log_fn = log_stderr;
        udev->log_priority = LOG_ERR;
        udev_list_init(&udev->properties_list);
-       udev->run = 1;
        udev->dev_path = strdup("/dev");
        udev->sys_path = strdup("/sys");
        config_file = strdup(SYSCONFDIR "/udev/udev.conf");
@@ -140,10 +138,6 @@ struct udev *udev_new(void)
                udev_add_property(udev, "SYSFS_PATH", udev->sys_path);
        }
 
-       env = getenv("UDEV_RUN");
-       if (env != NULL && strcmp(env, "0") == 0)
-               udev->run = 0;
-
        env = getenv("UDEV_CONFIG_FILE");
        if (env != NULL) {
                free(config_file);
@@ -359,11 +353,6 @@ const char *udev_get_rules_path(struct udev *udev)
        return udev->rules_path;
 }
 
-int udev_get_run(struct udev *udev)
-{
-       return udev->run;
-}
-
 /**
  * udev_get_sys_path:
  * @udev: udev library context
index 75518f628d2cf3c082b04bf0f0f22faad6f577ce..28c833a9e5201856173f81a1ef115ca522393584 100644 (file)
@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
        if (udev_device_get_event_timeout(dev) >= 0)
                alarm(udev_device_get_event_timeout(dev));
 
-       if (err == 0 && udev_get_run(udev))
+       if (err == 0)
                udev_event_execute_run(event, NULL);
 
        udev_event_unref(event);
index 5dd515bcdc897b4ea8272a91d039ea45b9972ad9..894620073abe41011093f175ae52ceec42223ebd 100644 (file)
@@ -119,14 +119,13 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
        udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev))
                info(udev, "%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
 
-       if (err == 0 && udev_get_run(udev)) {
+       if (err == 0)
                udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) {
                        char program[UTIL_PATH_SIZE];
 
                        udev_event_apply_format(event, udev_list_entry_get_name(entry), program, sizeof(program));
                        info(udev, "run: '%s'\n", program);
                }
-       }
        udev_event_unref(event);
        udev_device_unref(dev);
 exit:
index 99647c683cf90c933052e546cc34217093cce929..170225d00c85457f2fbdb735fb08e405c847190d 100644 (file)
@@ -292,12 +292,9 @@ static void worker_new(struct event *event)
                        if (udev_device_get_event_timeout(dev) >= 0)
                                alarm(udev_device_get_event_timeout(dev));
 
-                       /* execute RUN= */
-                       if (err == 0 && udev_get_run(udev_event->udev))
-                               failed = udev_event_execute_run(udev_event,
-                                                               &orig_sigmask);
+                       if (err == 0)
+                               failed = udev_event_execute_run(udev_event, &orig_sigmask);
 
-                       /* reset alarm */
                        alarm(0);
 
                        /* apply/restore inotify watch */
@@ -309,7 +306,7 @@ static void worker_new(struct event *event)
                        /* send processed event back to libudev listeners */
                        udev_monitor_send_device(worker_monitor, NULL, dev);
 
-                       /* send back the result of the event execution */
+                       /* send udevd the result of the event execution */
                        if (err != 0)
                                msg.exitcode = err;
                        else if (failed != 0)