man/man3/posix_spawn.3: Check for executable name in example
PATCH 1/1 man/man3/posix_spawn.3: Check for executable name in example
From: "Dr. David Alan Gilbert" <[email protected]>
Make the example check for an executable name on the command line rather than segfaulting in the child.
Signed-off-by Dr. David Alan Gilbert <[email protected]>
--- man/man3/posix_spawn.3 | 5 +++++ 1 file changed, 5 insertions(+)
man/man3/posix_spawn.3 +5 -0
@@ -730,6 +730,11 @@ .SS Program source break; } } +\& + if (!argv[optind]) { + fprintf(stderr, "Usage: %s [\-cs] executable [args]\[rs]n", argv[0]); + exit(EXIT_FAILURE); + } \& /* Spawn the child. The name of the program to execute and the command\-line arguments are taken from the command\-line arguments
Signature · 1 line
2.50.1
Alejandro Colomar
maintainerHi Dave,
Quoted 6 lines · On Mon, Aug 18, 2025 at 11:59:10PM +0100, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
Make the example check for an executable name on the command line rather than segfaulting in the child.
Signed-off-by Dr. David Alan Gilbert <[email protected]>
Thanks! I've applied the patch.
Have a lovely day!
Alex
Quoted 24 lines
--- man/man3/posix_spawn.3 | 5 +++++ 1 file changed, 5 insertions(+)man/man3/posix_spawn.3 +5
-0@@ -730,6 +730,11 @@ .SS Program source break; } } +\& + if (!argv[optind]) { + fprintf(stderr, "Usage: %s [\-cs] executable [args]\[rs]n", argv[0]); + exit(EXIT_FAILURE); + } \& /* Spawn the child. The name of the program to execute and the command\-line arguments are taken from the command\-line argumentsSignature · 1 line
2.50.1
Signature · 1 line
<https://www.alejandro-colomar.es/>