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 <bluca@debian.org>
Thu, 15 Aug 2024 12:08:37 +0000 (13:08 +0100)
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.

(cherry picked from commit ab9af70edb23f2a66e93e2e16f87cd98873885b7)

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

index ffea0ba082d86c56e5acc6f46cf121ef9374a9b3..73a95e7fa13538dca4a8f4d16ecc2206343d41d7 100644 (file)
@@ -3867,7 +3867,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];