On the importance of return codes
Posted Dec 3, 2009 9:57 UTC (Thu) by hppnq
In reply to: On the importance of return codes
Parent article: On the importance of return codes
That's because getenv(), unlike unsetenv(), does not always check for a corrupt environment: it simply loops over the entire environment when the program brings its own. So getenv() skips environ and reads LD_PRELOAD from environ, while unsetenv() complains about the corrupted environ.
It seems only a relatively recent change to unsetenv() introduced a non-void return value, and that the loader code was not updated at the same time.
to post comments)