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

PATCH: Re: PATCH: Re: zsh tests (dev-15)



On Mar 11,  8:41pm, Oliver Kiddle wrote:
} Subject: PATCH: Re: zsh tests (dev-15)
}
} After a quick look at some man pages, it seems that Linux maybe doesn't
} have faccessx(). Is this right?

Here's a follow-up patch to test for faccessx() and omit Oliver's bit
if it isn't found.  I've taken the liberty of rearranging the function
list for AC_CHECK_FUNCS a bit so that related things are grouped, after
a fashion.

I've kept the backslash at the end of every line, but are those really
necessary?  I thought m4 would do the right thing with macro arguments
that span multiple lines.

Index: configure.in
===================================================================
@@ -802,22 +802,33 @@
 #include <netinet/in.h>
 ], struct sockaddr_in6, sin6_scope_id)
 
+dnl ---------------
+dnl CHECK FUNCTIONS
+dnl ---------------
+
 dnl need to integrate this function
 dnl AC_FUNC_STRFTIME
 
-AC_CHECK_FUNCS(lchown memcpy memmove \
-              strftime waitpid select poll tcsetpgrp tcgetattr strstr lstat \
-              getlogin setpgid gettimeofday gethostname mkfifo wait3 difftime \
-              sigblock sigsetmask sigrelse sighold killpg sigaction getrlimit \
-              sigprocmask setuid seteuid setreuid setresuid setsid strerror \
-              nis_list initgroups fchdir cap_get_proc readlink nice \
-	      getgrgid getgrnam getpwent getpwnam getpwuid setpgrp \
-	      inet_aton inet_pton inet_ntop getipnodebyname gethostbyname2 \
-	      fseeko ftello mmap munmap msync ftruncate setlocale _mktemp)
+AC_CHECK_FUNCS(strftime difftime gettimeofday \
+	       select poll \
+	       readlink lstat lchown faccessx fchdir ftruncate \
+	       fseeko ftello \
+	       mkfifo _mktemp \
+	       waitpid wait3 \
+	       sigaction sigblock sighold sigrelse sigsetmask sigprocmask \
+	       killpg setpgid setpgrp tcsetpgrp tcgetattr nice \
+	       gethostname gethostbyname2 getipnodebyname \
+	       inet_aton inet_pton inet_ntop \
+	       getlogin getpwent getpwnam getpwuid getgrgid getgrnam \
+	       initgroups nis_list \
+	       setuid seteuid setreuid setresuid setsid \
+	       memcpy memmove strstr strerror \
+	       mmap munmap msync \
+	       cap_get_proc \
+	       getrlimit \
+	       setlocale)
+AC_FUNC_STRCOLL
 
-dnl ---------------
-dnl CHECK FUNCTIONS
-dnl ---------------
 if test $ac_cv_func_setpgrp = yes; then
   AC_FUNC_GETPGRP
 else
@@ -828,7 +839,6 @@
   ac_cv_func_getpgrp_void=yes
   AC_DEFINE(GETPGRP_VOID)
 fi
-AC_FUNC_STRCOLL
 
 if test $dynamic = yes; then
   AC_CHECK_FUNCS(dlopen dlerror dlsym dlclose load loadquery loadbind unload \
Index: Src/cond.c
===================================================================
@@ -310,9 +310,10 @@
 static int
 doaccess(char *s, int c)
 {
+#ifdef HAVE_FACCESSX
     if (!strncmp(s, "/dev/fd/", 8))
 	return !faccessx(atoi(s + 8), c, ACC_SELF);
-
+#endif
     return !access(unmeta(s), c);
 }
 

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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