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.
This commit is contained in:
sharad3001
2024-03-13 22:25:22 +09:00
committed by GitHub
parent cac8e820d6
commit e0cd8a1bdf
+1
View File
@@ -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;