Re: [PATCH 2/2] tests: drop unused link dependency

2011-04-26 Thread Jim Meyering
Eric Blake wrote: > Ever since commit 2392b18099, openat and fdopendir no longer drag in > xalloc-die through indirect dependencies, so these tests no longer > need $(LIBINTL). > > * modules/areadlinkat-tests (Makefile.am): Drop stale LDADD. > * modules/dirent-safer-tests (Makefile.am): Likewise. >

[PATCH 1/2] hash, mgetgroups: drop xalloc dependency

2011-04-26 Thread Eric Blake
Merely including xalloc.h can drag in some unwanted link dependencies on some platforms. safe-alloc.c is already one example of a file that broke the cycle by duplicating the xalloc_oversized macro. * lib/hash.c (hash_oversized): Copy from xalloc.h. * lib/mgetgroups.c (mgetgroups_oversized): Like

[PATCH 2/2] tests: drop unused link dependency

2011-04-26 Thread Eric Blake
Ever since commit 2392b18099, openat and fdopendir no longer drag in xalloc-die through indirect dependencies, so these tests no longer need $(LIBINTL). * modules/areadlinkat-tests (Makefile.am): Drop stale LDADD. * modules/dirent-safer-tests (Makefile.am): Likewise. * modules/fdopendir-tests (Mak

Re: [PATCHv2 5/9] dirent-safer: drop unused link dependency

2011-04-26 Thread Eric Blake
On 04/26/2011 07:28 PM, Eric Blake wrote: > On 04/26/2011 05:35 PM, Eric Blake wrote: >> Ever since commit 2392b18099, fdopendir no longer drags in xalloc-die >> through indirect dependencies, so this test no longer needs $(LIBINTL). >> >> * modules/dirent-safer-tests (Makefile.am): Drop stale LDAD

Re: mkstemp

2011-04-26 Thread Bruno Haible
Reuben Thomas wrote: > From mkstemp(3): > >More generally, the POSIX specification of mkstemp() does not > say anything about file modes, >so the application should make sure its file mode creation mask > (see umask(2)) is set >appropriately before calling mkstemp() (and mk

Re: [PATCHv2 4/9] save-cwd: reduce dependency

2011-04-26 Thread Eric Blake
On 04/26/2011 07:03 PM, Bruno Haible wrote: > Eric Blake wrote: >> diff --git a/modules/save-cwd b/modules/save-cwd >> index 02a0723..974b596 100644 >> --- a/modules/save-cwd >> +++ b/modules/save-cwd >> @@ -9,7 +9,7 @@ m4/save-cwd.m4 >> Depends-on: >> chdir-long >> cloexec >> -getcwd >> +getcwd

Re: [PATCHv2 5/9] dirent-safer: drop unused link dependency

2011-04-26 Thread Eric Blake
On 04/26/2011 05:35 PM, Eric Blake wrote: > Ever since commit 2392b18099, fdopendir no longer drags in xalloc-die > through indirect dependencies, so this test no longer needs $(LIBINTL). > > * modules/dirent-safer-tests (Makefile.am): Drop stale LDADD. NAK to this patch (but that doesn't affect

Re: [PATCHv2 4/9] save-cwd: reduce dependency

2011-04-26 Thread Bruno Haible
Eric Blake wrote: > diff --git a/modules/save-cwd b/modules/save-cwd > index 02a0723..974b596 100644 > --- a/modules/save-cwd > +++ b/modules/save-cwd > @@ -9,7 +9,7 @@ m4/save-cwd.m4 > Depends-on: > chdir-long > cloexec > -getcwd > +getcwd-lgpl > fchdir > stdbool > unistd-safer Here it woul

Re: [PATCHv2 2/9] getcwd-lgpl: new module

2011-04-26 Thread Bruno Haible
Hi Eric, Now the code is clear enough that it can be understood :-) I have three remarks: > +AC_DEFUN([gl_FUNC_GETCWD_LGPL], > +[ > + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) > + AC_REQUIRE([gl_FUNC_GETCWD_NULL]) > + > + case $gl_cv_func_getcwd_null in > + *yes) ;; > + *) > +dnl Minimal replac

Re: [PATCH 2/3] getcwd-lgpl: new module

2011-04-26 Thread Bruno Haible
Hi Eric, > My v2 rewrite uses more variables, with better names, to hopefully make > the logic easier to follow. Yes, it is easier to follow. Thanks for the improvements. > I've altered v2 to break the work into 4 phases: > > if (buf) return getcwd() > if (size) single malloc, getcwd, free buf

mkstemp

2011-04-26 Thread Reuben Thomas
>From mkstemp(3): More generally, the POSIX specification of mkstemp() does not say anything about file modes, so the application should make sure its file mode creation mask (see umask(2)) is set appropriately before calling mkstemp() (and mkostemp()). Does setting a 0600 um

[PATCHv2 9/9] fchdir: avoid extra chdir and fix test

2011-04-26 Thread Eric Blake
On Linux, with a forced ac_cv_func_fchdir=no, the test failed because dup2 was not replaced, all because the shell variable ac_cv_func_dup2 had not been set yet. Meanwhile, computing the canonical pathname of a directory on mingw was rather expensive -- multiple chdir()! -- but nothing cared wheth

[PATCHv2 8/9] filenamecat-lgpl: fix licence

2011-04-26 Thread Eric Blake
http://lists.gnu.org/archive/html/bug-gnulib/2009-10/msg00299.html talked about splitting out LGPLv2+ portions of existing modules. * modules/filenamecat-lgpl (License): Mark as LGPLv2+, as intended when it was first created. Signed-off-by: Eric Blake --- ChangeLog|4 m

[PATCHv2 7/9] linkat, renameat: add missing dependency

2011-04-26 Thread Eric Blake
* modules/linkat (Depends-on): Require getcwd-lgpl. * modules/renameat (Depends-on): Likewise. Signed-off-by: Eric Blake --- ChangeLog|4 modules/linkat |1 + modules/renameat |1 + 3 files changed, 6 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog in

[PATCHv2 3/9] getcwd: enhance tests

2011-04-26 Thread Eric Blake
* tests/test-getcwd-lgpl.c: New file, taken from... * tests/test-getcwd.c: ...old contents. Rewrite this file to repeat long path stress tests from m4 probe. * modules/getcwd-lgpl-tests: New module. * modules/getcwd-tests (Depends-on): Depend on lgpl tests. * m4/getcwd-abort-bug.m4: Update comment

[PATCHv2 6/9] tests: reduce dependencies

2011-04-26 Thread Eric Blake
We can assume that tests won't be run from a directory with an absolute name longer than native getcwd limits. * tests/test-linkat.c (main): Use lighter-weight getcwd. * tests/test-renameat.c (main): Likewise. * modules/linkat-tests (Depends-on): Relax dependency. * modules/renameat-tests (Depends

[PATCHv2 2/9] getcwd-lgpl: new module

2011-04-26 Thread Eric Blake
For programs that aren't worried about being invoked from an current working directory longer than PATH_MAX (perhaps because the program always does chdir to a sane location first), the getcwd module is overkill, given that all modern portability targets have a getcwd that works on short names. *

[PATCHv2 5/9] dirent-safer: drop unused link dependency

2011-04-26 Thread Eric Blake
Ever since commit 2392b18099, fdopendir no longer drags in xalloc-die through indirect dependencies, so this test no longer needs $(LIBINTL). * modules/dirent-safer-tests (Makefile.am): Drop stale LDADD. Signed-off-by: Eric Blake --- ChangeLog |3 +++ modules/dirent-safer-t

[PATCHv2 4/9] save-cwd: reduce dependency

2011-04-26 Thread Eric Blake
save-cwd needs either a working fchdir or a working getcwd(NULL). The only platform where getcwd fixes problems not solved by getcwd-lgpl is Linux, but fchdir works there. * modules/save-cwd (Depends-on): Use getcwd-lgpl. Signed-off-by: Eric Blake --- ChangeLog|3 +++ modules/save-c

[PATCHv2 1/9] getcwd: tweak comments

2011-04-26 Thread Eric Blake
* m4/getcwd-abort-bug.m4: Fix comments. * m4/getcwd-path-max.m4: Likewise. * m4/getcwd.m4: Likewise. Signed-off-by: Eric Blake --- ChangeLog |7 +++ m4/getcwd-abort-bug.m4 |4 ++-- m4/getcwd-path-max.m4 |4 ++-- m4/getcwd.m4 |4 +++- 4 files changed, 1

[PATCHv2 0/9] reduce getcwd weight

2011-04-26 Thread Eric Blake
Round 2; addresses the comments from round one, and scrubs the rest of gnulib for clients of getcwd that can benefit from the new module. Eric Blake (9): getcwd: tweak comments getcwd-lgpl: new module getcwd: enhance tests save-cwd: reduce dependency dirent-safer: drop unused link depend

Re: [PATCH 2/3] getcwd-lgpl: new module

2011-04-26 Thread Eric Blake
On 04/26/2011 04:34 AM, Bruno Haible wrote: > Hi Eric, > > Good move. I also like to see a glibc compatible getcwd() that does not > require the complex 'openat' and 'fdopendir' machinery. > > A remark regarding copyright. Through your now module, lib/getcwd.c changes > from GPLv3+ to LGPLv2+. (I

Re: sharutils-4.11 does not compile on Solaris

2011-04-26 Thread Bruce Korb
Hi Bruno, Thank you. On 04/19/11 15:16, Bruno Haible wrote: I would say: 0. Install gettext 0.18.1 on the machine on which you build the releases, and write AM_GNU_GETTEXT_VERSION([0.18.1]) in your configure.ac. <> 1. call autopoint 2. call gnulib-tool --import 3. call "AUTOPOINT=true a

[PATCH 5/4] inttypes: also provide default values for 32-bit tests

2011-04-26 Thread Paul Eggert
Further testing found a typo in my previous 4 patches, which is fixed by the following additional patch. In rereading them I think they respond to all the previous comments and therefore shouldn't be controversial so I pushed them. (If I'm wrong, please feel free to fix any chaos that results. :

Re: [PATCH 1/3] getcwd: consolidate m4 files

2011-04-26 Thread Eric Blake
On 04/25/2011 11:55 PM, Jim Meyering wrote: > Eric Blake wrote: >> It was confusing having 1 out of 3 known getcwd problems checked >> in place, and the other two in separate files. >> >> * m4/getcwd-abort-bug.m4, m4/getcwd-path-max.m4: Delete, moving >> contents... >> * m4/getcwd.m4: Here. >> * mo

[Bug Report] gnulib pthread detection prevents coreutils sort from linking

2011-04-26 Thread Gary V. Vaughan
When building coreutils-8.11 on Irix 6.3 and Tru64 Unix 5.1, linking of sort always fails because LIB_PTHREAD=''. Looking through src/ Makefile.am shows that LIBMULTITHREAD='-lpthread' in both cases, but sort links with LIB_PTHREAD which is empty, leaving pthread symbols unresolved. I'm guessing

Re: [PATCH 2/3] getcwd-lgpl: new module

2011-04-26 Thread Jim Meyering
Bruno Haible wrote: > Hi Eric, > > Good move. I also like to see a glibc compatible getcwd() that does not > require the complex 'openat' and 'fdopendir' machinery. > > A remark regarding copyright. Through your now module, lib/getcwd.c changes > from GPLv3+ to LGPLv2+. (It is too hard to explain t

Re: [PATCH 2/3] getcwd-lgpl: new module

2011-04-26 Thread Bruno Haible
Eric Blake wrote: > +  do > +    { > +      tmp = buf; > +      if (first) > +        { > +          size = size ? size : 4096; > +          first = false; > +        } > +      else > +        { > +          size <<= 1; > +        } > +      if ((buf = realloc (tmp, size)) == NULL) A further hint

Re: attributes pure and const

2011-04-26 Thread Jim Meyering
Bruno Haible wrote: > Hi Jim, > >> I've started using some new gcc-4.6 options, >> by adding these lines to coreutils' configure.ac: >> >> + gl_WARN_ADD([-Wsuggest-attribute=const]) >> + gl_WARN_ADD([-Wsuggest-attribute=pure]) >> + gl_WARN_ADD([-Wsuggest-attribute=noreturn]) >> >> I'

Re: [PATCH 2/3] getcwd-lgpl: new module

2011-04-26 Thread Bruno Haible
Hi Eric, Good move. I also like to see a glibc compatible getcwd() that does not require the complex 'openat' and 'fdopendir' machinery. A remark regarding copyright. Through your now module, lib/getcwd.c changes from GPLv3+ to LGPLv2+. (It is too hard to explain to lawyers that part of a file co