mount,swap: write event loop priority as "SD_EVENT_PRIORITY_NORMAL-x"
authorLennart Poettering <lennart@poettering.net>
Tue, 23 Jan 2018 17:13:01 +0000 (18:13 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 Jan 2018 17:13:01 +0000 (18:13 +0100)
We do that in all other cases, let's do it here too. Since
SD_EVENT_PRIORITY_NORMAL evaluates to zero there's zero effective
difference, but it makes things easier to grok and grep for if we always
express relative priorities within PID 1 only.

src/core/mount.c
src/core/swap.c

index 453a83f..4c12542 100644 (file)
@@ -1753,7 +1753,7 @@ static void mount_enumerate(Manager *m) {
                         goto fail;
                 }
 
-                r = sd_event_source_set_priority(m->mount_event_source, -10);
+                r = sd_event_source_set_priority(m->mount_event_source, SD_EVENT_PRIORITY_NORMAL-10);
                 if (r < 0) {
                         log_error_errno(r, "Failed to adjust mount watch priority: %m");
                         goto fail;
index 849ccbd..70097ff 100644 (file)
@@ -1309,7 +1309,7 @@ static void swap_enumerate(Manager *m) {
                 /* Dispatch this before we dispatch SIGCHLD, so that
                  * we always get the events from /proc/swaps before
                  * the SIGCHLD of /sbin/swapon. */
-                r = sd_event_source_set_priority(m->swap_event_source, -10);
+                r = sd_event_source_set_priority(m->swap_event_source, SD_EVENT_PRIORITY_NORMAL-10);
                 if (r < 0) {
                         log_error_errno(r, "Failed to change /proc/swaps priority: %m");
                         goto fail;