]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-event: change error code -EINVAL -> -EIO
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 4 Aug 2024 02:29:03 +0000 (11:29 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sun, 4 Aug 2024 09:33:23 +0000 (11:33 +0200)
EINVAL should be used when a function is called with an invalid
argument. Here, the signal is not a function argument.

Follow-up for 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9.

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

index a593d0e50dbfe558c313d26cbb8dbd3e3ad2206f..77d2c116db8fb182aa0fd65db24017be69e198ec 100644 (file)
@@ -3872,7 +3872,7 @@ static int process_signal(sd_event *e, struct signal_data *d, uint32_t events, i
                         return -EIO;
 
                 if (_unlikely_(!SIGNAL_VALID(si.ssi_signo)))
-                        return -EINVAL;
+                        return -EIO;
 
                 if (e->signal_sources)
                         s = e->signal_sources[si.ssi_signo];