]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-event: Drop faulty shortcut
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 13 Nov 2025 21:33:11 +0000 (22:33 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 14 Nov 2025 09:34:32 +0000 (10:34 +0100)
We can't take this shortcut, as we might have to drop the
EPOLLONESHOT flag for some event sources, so drop the shortcut.

src/libsystemd/sd-event/sd-event.c

index 7d8d779742f4c445499fb1fb6799c04cae374a93..fbe7656925ed82c4cc7b875e15430b42e4837628 100644 (file)
@@ -3044,16 +3044,8 @@ _public_ int sd_event_source_set_enabled(sd_event_source *s, int m) {
 
         if (m == SD_EVENT_OFF)
                 r = event_source_offline(s, m, s->ratelimited);
-        else {
-                if (s->enabled != SD_EVENT_OFF) {
-                        /* Switching from "on" to "oneshot" or back? If that's the case, we can take a shortcut, the
-                         * event source is already enabled after all. */
-                        s->enabled = m;
-                        return 0;
-                }
-
+        else
                 r = event_source_online(s, m, s->ratelimited);
-        }
         if (r < 0)
                 return r;