]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-fdtab: Fix wrong return in exec handler
authorAndrei Tatar <andrei@unikraft.io>
Wed, 19 Feb 2025 11:54:31 +0000 (12:54 +0100)
committerUnikraft Bot <monkey@unikraft.io>
Sun, 23 Feb 2025 10:29:25 +0000 (10:29 +0000)
Previously fdtab_handle_execve would return 0 on success, as per common
convention. This is however wrong for event handlers, as these require
specific exit codes on success; in this case UK_EVENT_HANDLED_CONT.
This change fixes this oversight.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Approved-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
GitHub-Closes: #1278

lib/posix-fdtab/fdtab.c

index f78fd7ed8c81a964091365f6b33966a71600cbf3..607ea240d18df3d610413db3eb6418a3bc2e90aa 100644 (file)
@@ -392,13 +392,13 @@ void uk_fdtab_cloexec(void)
        fdtab_cleanup(active_fdtab, 0);
 }
 
+#if CONFIG_LIBPOSIX_PROCESS_EXECVE
 static int fdtab_handle_execve(void *data __unused)
 {
        uk_fdtab_cloexec();
-       return 0;
+       return UK_EVENT_HANDLED_CONT;
 }
 
-#if CONFIG_LIBPOSIX_PROCESS_EXECVE
 UK_EVENT_HANDLER_PRIO(POSIX_PROCESS_EXECVE_EVENT, fdtab_handle_execve,
                      UK_PRIO_EARLIEST);
 #endif /* CONFIG_LIBPOSIX_PROCESS_EXECVE */