]> err.no Git - systemd/commitdiff
udevd: do not nice processes
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 14 Apr 2011 10:25:19 +0000 (12:25 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 14 Apr 2011 10:25:19 +0000 (12:25 +0200)
libudev/libudev-private.h
libudev/libudev-util-private.c
udev/udev-event.c
udev/udev-rules.c
udev/udevd.c

index c57a89873cbc575807db39d36fa21a8c75f17f2d..e82ca1d753218dc9beb513e1bc7aefdc85c7737d 100644 (file)
@@ -235,7 +235,7 @@ uid_t util_lookup_user(struct udev *udev, const char *user);
 gid_t util_lookup_group(struct udev *udev, const char *group);
 int util_run_program(struct udev *udev, const char *command, char **envp,
                     char *result, size_t ressize, size_t *reslen,
-                    const sigset_t *sigmask, bool reset_prio);
+                    const sigset_t *sigmask);
 int util_resolve_subsys_kernel(struct udev *udev, const char *string,
                                      char *result, size_t maxsize, int read_value);
 unsigned long long usec_monotonic(void);
index 073f7e2df8fa1b54d28f079ba48b89e3e98232b3..c7ad20eb749323963fce27f1893f834ac79df8da 100644 (file)
@@ -261,7 +261,7 @@ int util_resolve_subsys_kernel(struct udev *udev, const char *string,
 
 int util_run_program(struct udev *udev, const char *command, char **envp,
                     char *result, size_t ressize, size_t *reslen,
-                    const sigset_t *sigmask, bool reset_prio)
+                    const sigset_t *sigmask)
 {
        int status;
        int outpipe[2] = {-1, -1};
@@ -356,8 +356,6 @@ int util_run_program(struct udev *udev, const char *command, char **envp,
 
                if (sigmask)
                        sigprocmask(SIG_SETMASK, sigmask, NULL);
-               if (reset_prio)
-                       setpriority(PRIO_PROCESS, 0, 0);
 
                execve(argv[0], argv, envp);
                if (errno == ENOENT || errno == ENOTDIR) {
index 63a8b3aa830d9db833614a7ffa678ec21aa5de18..60d06aa084900e2a3c10dc3127bf76fd59dfa59f 100644 (file)
@@ -688,7 +688,7 @@ int udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask)
                                info(event->udev, "delay execution of '%s'\n", program);
                                sleep(event->exec_delay);
                        }
-                       if (util_run_program(event->udev, program, envp, NULL, 0, NULL, sigmask, true) != 0) {
+                       if (util_run_program(event->udev, program, envp, NULL, 0, NULL, sigmask) != 0) {
                                if (udev_list_entry_get_flags(list_entry))
                                        err = -1;
                        }
index 805f449f225394c8e116fe3d8e8c9c89464a4d8d..bef5abab5e4dc5da9fc96faef2b1635b9758b680 100644 (file)
@@ -759,7 +759,7 @@ static int import_program_into_properties(struct udev_device *dev, const char *p
        char *line;
 
        envp = udev_device_get_properties_envp(dev);
-       if (util_run_program(udev, program, envp, result, sizeof(result), &reslen, NULL, false) != 0)
+       if (util_run_program(udev, program, envp, result, sizeof(result), &reslen, NULL) != 0)
                return -1;
 
        line = result;
@@ -2297,7 +2297,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
                                     program,
                                     &rules->buf[rule->rule.filename_off],
                                     rule->rule.filename_line);
-                               if (util_run_program(event->udev, program, envp, result, sizeof(result), NULL, NULL, false) != 0) {
+                               if (util_run_program(event->udev, program, envp, result, sizeof(result), NULL, NULL) != 0) {
                                        if (cur->key.op != OP_NOMATCH)
                                                goto nomatch;
                                } else {
index 051e8fe527b21e0c4f92983c9156070941489744..244780ab57a02f7b93ab5edeb7ff9828ff48ff5f 100644 (file)
@@ -47,9 +47,6 @@
 #include "udev.h"
 #include "sd-daemon.h"
 
-#define UDEVD_PRIORITY                 -4
-#define UDEV_PRIORITY                  -2
-
 static bool debug;
 
 static void log_fn(struct udev *udev, int priority,
@@ -267,7 +264,6 @@ static void worker_new(struct event *event)
                close(worker_watch[READ_END]);
                udev_log_close();
                udev_log_init("udevd-work");
-               setpriority(PRIO_PROCESS, 0, UDEV_PRIORITY);
 
                /* set signal handlers */
                memset(&act, 0x00, sizeof(act));
@@ -1426,9 +1422,6 @@ int main(int argc, char *argv[])
        if (fd > STDERR_FILENO)
                close(fd);
 
-       /* set scheduling priority for the main daemon process */
-       setpriority(PRIO_PROCESS, 0, UDEVD_PRIORITY);
-
        setsid();
 
        f = fopen("/dev/kmsg", "w");