Re: bug#9076: coreutils-8.12 uses SA_RESETHAND and SA_RESTART unconditionally

2011-07-15 Thread Paul Eggert
On 07/15/11 03:28, Bruno Haible wrote: > Paul Eggert wrote: >> --- a/doc/posix-functions/sigaction.texi >> +++ b/doc/posix-functions/sigaction.texi > > A documentation update for the header file, in doc/posix-headers/signal.texi, > would also be useful. Thanks, I pushed this: doc: Document NonSt

Re: [PATCH 2/2] ffsl, ffsll: new modules

2011-07-15 Thread Bruno Haible
Eric Blake wrote: > +int > +FUNC (TYPE i) > +{ > + int result = 0; > + unsigned TYPE j = i; > + > + /* GCC has __builtin_ffs, but it is limited to int. */ > + if (!i) > +return 0; > + while (1) > +{ > + if ((int) j) > +return result + ffs (j); > + j >>= CHAR_BIT * si

Re: bug#9076: coreutils-8.12 uses SA_RESETHAND and SA_RESTART unconditionally

2011-07-15 Thread Paul Eggert
On 07/15/11 03:28, Pádraig Brady wrote: > What I was getting was that it's probably better to leave > the following to the app too: > > #ifndef SA_RESETHAND > # define SA_RESETHAND 0 > /* Now the app writer knows they need to handle this case */ > #endif Yes, you're probably right. I'll send som

Re: [PATCH 2/2] ffsl, ffsll: new modules

2011-07-15 Thread Bruno Haible
Eric Blake wrote: > * modules/ffsl-tests: New test file. > * modules/ffsll-tests: Likewise. > * tests/test-ffsl.c: Likewise. > * tests/test-ffsll.c: Likewise. It doesn't hurt to clarify how these functions work on bit patterns that represent "negative" numbers and have more than one bit set. 201

[PATCH 2/2] ffsl, ffsll: new modules

2011-07-15 Thread Eric Blake
* modules/ffsl: New file. * modules/ffsll: Likewise. * m4/ffsl.m4: Likewise. * m4/ffsll.m4: Likewise. * lib/ffsl.c: Likewise. * lib/ffsl.h: Likewise. * lib/ffsll.c: Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_BODY) (gl_HEADER_STRING_H_DEFAULTS): Add defaults. * modules/string (Makefile.am): Subs

[PATCH 1/2] ffs: fix m4 prerequisite

2011-07-15 Thread Eric Blake
* m4/ffs.m4 (gl_FUNC_FFS): Require strings.h defaults. Signed-off-by: Eric Blake --- ChangeLog |3 +++ m4/ffs.m4 |3 ++- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a67a7e..49dcd7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 201

[PATCH] ffs: avoid undefined behavior

2011-07-15 Thread Eric Blake
* lib/ffs.c (ffs): Provide fallback for non-32-bit int. * tests/test-ffs.c (naive, main): Avoid signed shifts. Reported by Bruno Haible. Signed-off-by: Eric Blake --- ChangeLog|7 +++ lib/ffs.c| 31 +++ tests/test-ffs.c |8 3 fil

ifdef setpgid() usage in lib/spawni.c for Minix

2011-07-15 Thread Thomas Cort
Hello, I've been working on pkgsrc for the Minix project and we've been patching lib/spawni.c in several packages (bison, gettext, m4, ...) because Minix lacks setpgid(). I lack the autotools and gnulib knowledge to patch & test gnulib itself, but in general the fix would involve adding a check fo

Re: bug#9076: coreutils-8.12 uses SA_RESETHAND and SA_RESTART unconditionally

2011-07-15 Thread Eric Blake
On 07/15/2011 04:28 AM, Pádraig Brady wrote: > On 15/07/11 08:50, Paul Eggert wrote: >> On 07/14/11 17:25, Pádraig Brady wrote: >>> I'm not sure about defining these to 0 in gnulib. >>> That will silently ignore the intent of a program on certain platforms. > Absolutely. What I was getting was tha

Re: bug#9076: coreutils-8.12 uses SA_RESETHAND and SA_RESTART unconditionally

2011-07-15 Thread Pádraig Brady
On 15/07/11 08:50, Paul Eggert wrote: > On 07/14/11 17:25, Pádraig Brady wrote: >> I'm not sure about defining these to 0 in gnulib. >> That will silently ignore the intent of a program on certain platforms. >> Wouldn't it be better to fail to compile so that each program then does: >> >> #ifndef S

Re: bug#9076: coreutils-8.12 uses SA_RESETHAND and SA_RESTART unconditionally

2011-07-15 Thread Bruno Haible
Paul Eggert wrote: > --- a/doc/posix-functions/sigaction.texi > +++ b/doc/posix-functions/sigaction.texi A documentation update for the header file, in doc/posix-headers/signal.texi, would also be useful. Bruno -- In memoriam Natalya Estemirova

Re: bug#9076: coreutils-8.12 uses SA_RESETHAND and SA_RESTART unconditionally

2011-07-15 Thread Paul Eggert
On 07/14/11 17:25, Pádraig Brady wrote: > I'm not sure about defining these to 0 in gnulib. > That will silently ignore the intent of a program on certain platforms. > Wouldn't it be better to fail to compile so that each program then does: > > #ifndef SA_RESETHAND > /* do something else */ > #end