From e0cd8a1bdf6a780b82487c5cf3b4b6487a83a6e1 Mon Sep 17 00:00:00 2001 From: sharad3001 <46183881+sharad3001@users.noreply.github.com> Date: Wed, 13 Mar 2024 18:55:22 +0530 Subject: udev: add assert for EVENT_RESULT_EXIT_STATUS_BASE (#31710) EVENT_RESULT_EXIT_STATUS_BASE and EVENT_RESULT_SUCCESS has the same value. Code updated to add assert statement for EVENT_RESULT_EXIT_STATUS_BASE. --- src/udev/udev-worker.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/udev') diff --git a/src/udev/udev-worker.c b/src/udev/udev-worker.c index 4563d8807d..b038b68099 100644 --- a/src/udev/udev-worker.c +++ b/src/udev/udev-worker.c @@ -249,6 +249,7 @@ void udev_broadcast_result(sd_device_monitor *monitor, sd_device *dev, EventResu break; } case EVENT_RESULT_EXIT_STATUS_BASE ... EVENT_RESULT_EXIT_STATUS_MAX: + assert(result != EVENT_RESULT_EXIT_STATUS_BASE); (void) device_add_propertyf(dev, "UDEV_WORKER_EXIT_STATUS", "%i", result - EVENT_RESULT_EXIT_STATUS_BASE); break; -- cgit v1.2.3