Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: better support for BSDs for $ZSH_EXEPATH



I wrote:
> To implement $ZSH_EXEPATH there is Mac and Linux specific solutions
> followed by a fallback using argv[0] and a $PATH search. This adds a
> better approach for NetBSD, FreeBSD and DragonflyBSD based on sysctl(3).

Apparently on Linux systems of a certain age, sys/sysctl.h exists but
including it prints warnings about use of a deprecated header. On the
newer system I tested against it no longer exists. I can't find a better
way to avoid this warning than the following.

Oliver

diff --git a/Src/init.c b/Src/init.c
index 2f914f96b..61f759ded 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -36,7 +36,7 @@
 
 #include "version.h"
 
-#ifdef HAVE_SYS_SYSCTL_H
+#if defined(HAVE_SYS_SYSCTL_H) && !defined(__linux)
 #include <sys/sysctl.h>
 #endif
 




Messages sorted by: Reverse Date, Date, Thread, Author