catatonit currently fails to compile with musl because it uses the internal __environ variable which is not defined in musl's unistd.h:
catatonit.c: In function 'spawn_pid1':
catatonit.c:216:22: error: '__environ' undeclared (first use in this function); did you mean 'environ'?
216 | execvpe(file, argv, __environ);
| ^~~~~~~~~
| environ
This variable is also not mentioned in the glibc's documentation and should probably not be used. Changed it to the documented environ variable, which is also supported by musl with _GNU_SOURCE. With this PR, catatonit compiles successfully with both glibc and musl.
Fixes compilation with musl.
catatonit currently fails to compile with musl because it uses the internal
__environ
variable which is not defined in musl'sunistd.h
:This variable is also not mentioned in the glibc's documentation and should probably not be used. Changed it to the documented
environ
variable, which is also supported by musl with_GNU_SOURCE
. With this PR, catatonit compiles successfully with both glibc and musl.