From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21059 invoked from network); 8 Mar 2009 19:55:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,URIBL_SBL autolearn=no version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 Mar 2009 19:55:42 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 25834 invoked from network); 8 Mar 2009 19:55:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Mar 2009 19:55:34 -0000 Received: (qmail 20028 invoked by alias); 8 Mar 2009 19:55:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26697 Received: (qmail 20010 invoked from network); 8 Mar 2009 19:55:28 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 8 Mar 2009 19:55:28 -0000 Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bifrost.dotsrc.org (Postfix) with ESMTP id 9D01980307F8 for ; Sun, 8 Mar 2009 20:55:24 +0100 (CET) Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090308195523.PBGB4080.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Sun, 8 Mar 2009 19:55:23 +0000 Received: from pws-pc ([81.107.42.185]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090308195523.EPAC13254.aamtaout01-winn.ispmail.ntl.com@pws-pc> for ; Sun, 8 Mar 2009 19:55:23 +0000 Date: Sun, 8 Mar 2009 19:55:18 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: Modules/attr.c compile error on Mac OS X Message-ID: <20090308195518.7d1e7ee8@pws-pc> In-Reply-To: <16c5bb260903080021k4da0e6b1g8e40cc7520f84e8@mail.gmail.com> References: <16c5bb260903080021k4da0e6b1g8e40cc7520f84e8@mail.gmail.com> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.14.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=I1ULntJ0f4UA:10 a=TbTACPgREAoA:10 a=pGLkceISAAAA:8 a=NLZqzBF-AAAA:8 a=rVwHKsH9f4mOSr9ZJS4A:9 a=YbKcwlXblW-6vI5RBaUA:7 a=ds5LIWR5B4GbbJApzBsgXEI4Ki8A:4 a=LY0hPdMaydYA:10 a=wU2j-0zSEqIA:10 a=MSl-tDqOz04A:10 a=_dQi-Dcv4p4A:10 X-Virus-Scanned: ClamAV 0.92.1/9080/Fri Mar 6 20:13:38 2009 on bifrost X-Virus-Status: Clean On Sun, 8 Mar 2009 17:21:47 +0900 Taro M wrote: > The new Modules/attr.c does not compile on Mac OS X (and probably others): I don't know about the others, and you don't say, but a bit of research suggests Mac OS X takes some extra arguments. I don't have Mac OS X so can't test that; if it still doesn't compile, please could one of the numerous Mac users provide a patch. If it compiles but doesn't work, I will need someone else to research the problem. General reminder not aimed at anyone particular: as I keep saying, I really do need more help. Anyone with knowledge about specific systems that may need special help is encouraged to provide it; patches are useful even if incomplete (and preferred to text statements along the lines of "wouldn't it be better to change ..."). This is supposed to be a developer's mailing list. Thanks. Index: configure.ac =================================================================== RCS file: /cvsroot/zsh/zsh/configure.ac,v retrieving revision 1.119 diff -u -r1.119 configure.ac --- configure.ac 3 Mar 2009 15:04:17 -0000 1.119 +++ configure.ac 8 Mar 2009 19:51:18 -0000 @@ -1251,6 +1251,49 @@ shl_load shl_unload shl_findsym) fi +AH_TEMPLATE([XATTR_EXTRA_ARGS], +Define if getxattr() etc. require additional MacOS-style arguments) +if test x$ac_cv_func_getxattr = xyes && test x$ac_cv_header_sys_xattr_h = xyes +then + AC_CACHE_CHECK(if getxattr etc. are Linux-like, + zsh_cv_getxattr_linux, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], + [[ + (void)listxattr("", 0, 0); + (void)getxattr("", "", 0, 0); + (void)setxattr("", "", "", 0, 0); + (void)removexattr("", ""); + ]])], + [zsh_cv_getxattr_linux=yes], + [zsh_cv_getxattr_linux=no])]) + + if test x$zsh_cv_getxattr_linux != xyes; then + AC_CACHE_CHECK(if getxattr etc. are MAC-like, + zsh_cv_getxattr_mac, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], + [[(void)listxattr("", 0, 0, 0); + (void)getxattr("", "", 0, 0, 0, 0); + (void)setxattr("", "", "", 0, 0, 0); + (void)removexattr("", "", 0);]])], + [zsh_cv_getxattr_mac=yes], + [zsh_cv_getxattr_mac=no])]) + + if test x$zsh_cv_getxattr_mac = xyes; then + AC_DEFINE(XATTR_EXTRA_ARGS) + fi + fi +fi + +AC_CACHE_CHECK(if getxattr etc. are usable, +zsh_cv_use_xattr, +[if test x$zsh_cv_getxattr_linux = xyes || test x$zsh_cv_getxattr_mac = xyes +then +zsh_cv_use_xattr=yes +else +zsh_cv_use_xattr=no +fi]) dnl ------------- dnl CHECK SIGNALS Index: Src/Modules/attr.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/attr.c,v retrieving revision 1.2 diff -u -r1.2 attr.c --- Src/Modules/attr.c 3 Mar 2009 16:40:43 -0000 1.2 +++ Src/Modules/attr.c 8 Mar 2009 19:51:19 -0000 @@ -42,8 +42,16 @@ unmetafy(*argv, &slen); unmetafy(*(argv+1), NULL); - if (listxattr(*argv, NULL, 0) > 0) { - if (0 < (len = getxattr(*argv, *(argv+1), value, 255))) { + if (listxattr(*argv, NULL, 0 +#ifdef XATTR_EXTRA_ARGS + , 0 +#endif + ) > 0) { + if (0 < (len = getxattr(*argv, *(argv+1), value, 255 +#ifdef XATTR_EXTRA_ARGS + , 0, 0 +#endif + ))) { if (len < 256) { value[len] = '\0'; if (*(argv+2)) @@ -67,7 +75,11 @@ unmetafy(*argv, &slen); unmetafy(*(argv+1), NULL); unmetafy(*(argv+2), NULL); - if (setxattr(*argv, *(argv+1), *(argv+2), strlen(*(argv+2)), 0)) { + if (setxattr(*argv, *(argv+1), *(argv+2), strlen(*(argv+2)), 0 +#ifdef XATTR_EXTRA_ARGS + , 0 +#endif + )) { zwarnnam(nam, "%s: %e", metafy(*argv, slen, META_NOALLOC), errno); ret = 1; } @@ -81,7 +93,11 @@ unmetafy(*argv, &slen); unmetafy(*(argv+1), NULL); - if (removexattr(*argv, *(argv+1))) { + if (removexattr(*argv, *(argv+1) +#ifdef XATTR_EXTRA_ARGS + , 0 +#endif + )) { zwarnnam(nam, "%s: %e", metafy(*argv, slen, META_NOALLOC), errno); ret = 1; } @@ -96,7 +112,11 @@ char value[256]; unmetafy(*argv, &slen); - if (0 < (len = listxattr(*argv, value, 256))) { + if (0 < (len = listxattr(*argv, value, 256 +#ifdef XATTR_EXTRA_ARGS + , 0 +#endif + ))) { if (len < 256) { char *p = value; if (*(argv+1)) Index: Src/Modules/attr.mdd =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/attr.mdd,v retrieving revision 1.1 diff -u -r1.1 attr.mdd --- Src/Modules/attr.mdd 3 Mar 2009 15:04:28 -0000 1.1 +++ Src/Modules/attr.mdd 8 Mar 2009 19:51:19 -0000 @@ -1,5 +1,5 @@ name=zsh/attr -link='if test "x$ac_cv_func_getxattr" = xyes && test "x$ac_cv_header_sys_xattr_h" = xyes; then +link='if test "x$zsh_cv_use_xattr" = xyes; then echo dynamic else echo no -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/