Module Name: src Committed By: kre Date: Sun Feb 9 14:25:26 UTC 2025
Modified Files: src/usr.bin/env: env.1 env.c Log Message: PR bin/59058 Random minor corrections Use the correct exit status values (126 vs 127), the latter when the utility cannot be located (no matter why) and the former when it could be located, but an execvp() attempt failed for some other reason. Use exit status 125 for all errors detected by env itself, which require that it exit, but no longer consider including the -0 option along with a utility name to be such an error. The -0 is useless in such a case, but just ignore it (just as also happens if -u options are given with -i, which makes all -u options meaningless). Using 125 rather than a low number (like 1, which it mostly used to be) should make it slightly easier to detect cases where env has failed, rather than the named utility having failed. Write errors to stdout, and failure of putenv() are now detected and cause an error message and exit(125). The -C option now (also) causes PWD to be removed from the environment (better than it retaining an invalid value). (Currently OLDPWD is left alone, better might be possible.) Document all of that (and make it much clearer than when a utility is successfully invoked, the exit status, any value at all, comes from the utility, rather than pretending that utilities were only permitted to exit with status from 0..125. More wording fixes and clarifications in the man page. While there, delete the BUGS section, after implementing, and documenting, a mechanism to allow utility names to contain an '=' character (as useless as this change is likely to be in practice) - the implemented mechanism is extraordinarily simple (much simpler than this paragraph!) To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/usr.bin/env/env.1 cvs rdiff -u -r1.24 -r1.25 src/usr.bin/env/env.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.