diff --git a/code/debug/spy_getenv.c b/code/debug/spy_getenv.c index b35c673..1a0ed66 100644 --- a/code/debug/spy_getenv.c +++ b/code/debug/spy_getenv.c @@ -1,14 +1,10 @@ /* - * * spy_getenv.so: spy_getenv.c Makefile * gcc -Wall -shared -fPIC $< -ldl -o $@ - * */ - #include #include #include - #define __USE_GNU #include @@ -18,15 +14,12 @@ char *getenv(char *envname) { static char *arrow = "--getenv--> "; static char *wtf = " --> (nil)"; - char *content; original_getenv orig_getenv; orig_getenv = (original_getenv)dlsym(RTLD_NEXT, "getenv"); - write(STDERR_FILENO, arrow, strlen(arrow)); write(STDERR_FILENO, envname, strlen(envname)); - content = orig_getenv(envname); if (NULL != content) { write(STDERR_FILENO, "=", 1); @@ -35,9 +28,7 @@ if (NULL != content) { else { write(STDERR_FILENO, wtf, strlen(wtf)); } - write(STDERR_FILENO, "\n", 1); - return content; }