casaroli opened a new pull request, #20543: URL: https://github.com/apache/nuttx/pull/20543
## Summary `posix_spawn()` and `execve()` logged every failed exec at error level. A shell normally tries a program first: NSH with `CONFIG_NSH_FILE_APPS` spawns each command from `PATH` before its built-in command, and bash runs a script itself when `execve()` returns `ENOEXEC`. So with `CONFIG_DEBUG_SCHED_ERROR` every built-in NSH command printed an error although nothing was wrong. This PR stops logging `ENOENT` (no such program) and `ENOEXEC` (not a loadable format). The caller gets the error code and reports it if it needs to. Other errors are logged as before. ## Impact Debug output only, with `CONFIG_DEBUG_SCHED_ERROR`. No change to return values or `errno`. ## Testing `qemu-armv8a:knsh` with `CONFIG_DEBUG_SCHED_ERROR=y`, QEMU 11. Before: ``` nsh> mkdir /tmp2 nxposix_spawn_exec: ERROR: exec failed: 2 nsh> foo nxposix_spawn_exec: ERROR: exec failed: 2 nsh: foo: command not found ``` After: ``` nsh> mkdir /tmp2 nsh> foo nsh: foo: command not found ``` `mps2-an500:nsh` with the same options builds with `-Werror`. `tools/checkpatch.sh -c -u -m -g` passes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
