[PATCH 3/3] glob: test previous patch

2010-03-22 Thread Eric Blake
* tests/test-glob.c (main): Enhance test. * doc/posix-functions/glob.texi (glob): Document the fix. Signed-off-by: Eric Blake --- ChangeLog |6 +++ doc/posix-functions/glob.texi |4 ++ tests/test-glob.c | 78 ++-- 3 fi

[PATCH 1/3] glob: synchronize from glibc

2010-03-22 Thread Eric Blake
* lib/glob.c (glob): Lose register modifier. Drop redundant code. (globfree): Drop useless if-before-free. (collated_compare): Add const-safety. Signed-off-by: Eric Blake --- ChangeLog |8 lib/glob.c | 13 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --g

[PATCH 2/3] glob: fix empty pattern and patterns ending in slash

2010-03-22 Thread Eric Blake
From: Andreas Schwab * posix/glob.c (glob): Match only directories when pattern ends in a slash. Return no match when pattern is empty. Reported via Paolo Bonzini. Signed-off-by: Eric Blake --- ChangeLog |7 +++ lib/glob.c | 47 --- 2 fil

updating glob

2010-03-22 Thread Eric Blake
Updating glob is turning out to be trickier than I thought. For starters, m4/glob.m4 claims that the use of the glob module implies that you want GNU semantics; which means that we should really be creating glob-posix and glob-gnu, then making glob an alias for glob-gnu. Next, m4/glob.m4 claims th

[PATCH] gethostname: further tweaks

2010-03-22 Thread Eric Blake
* lib/unistd.in.h (includes): Only worry about if we are overriding gethostname. Suggested by Bruno Haible. Signed-off-by: Eric Blake --- > Would it be possible to conditionalize this with > #if @GNULIB_GETHOSTNAME@ > like it was before? In a package that has nothing to do with > sockets and

Re: port 'openpty' to all Unix platforms

2010-03-22 Thread Bruno Haible
Eric Blake wrote: > POSIX does not specify openpty, so this comment is misleading. Oops, you're right. Fixed: 2010-03-21 Bruno Haible Fix comments. * lib/forkpty.c (rpl_forkpty): Fix comment. * lib/openpty.c (rpl_openpty): Likewise. Reported by Eric Blake. --

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Bruno Haible
Eric Blake wrote: > +/* Get all possible declarations of gethostname().  */ > +#if @UNISTD_H_HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H > +# define _GL_INCLUDING_WINSOCK2_H > +# include > +# undef _GL_INCLUDING_WINSOCK2_H > +#endif > Would it be possible to conditionalize this with

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Matthias Bolte
2010/3/22 Eric Blake : > Since commit 4e86671a, gethostname failed to compile on mingw. > Gnulib's sys/socket.h includes winsock2.h, which then includes > unistd.h prior to declaring gethostname.  The fix is to ensure > that our replacement unistd.h does not declare any replacements > until we are

Re: Fwd: [PATCH] Fix glob with empty pattern and patterns ending in slash

2010-03-22 Thread Eric Blake
On 03/22/2010 11:28 AM, Paolo Bonzini wrote: > I think this should go in gnulib too, right? > > Paolo > > -- Forwarded message -- > From: Andreas Schwab > Date: Mon, Mar 22, 2010 at 16:13 > Subject: [PATCH] Fix glob with empty pattern and patterns ending in slash > To: libc-hac..

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Eric Blake
On 03/22/2010 11:56 AM, Simon Josefsson wrote: >> Typo on line 26. > > Thanks, now it works. Any reason not to push this? Only that I was not set up to reproduce the failure (cross-compiling from cygwin was running into its own set of problems, because cygwin's gcc-3 compiler mistakenly picks up

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Simon Josefsson
Eric Blake writes: > On 03/22/2010 11:39 AM, Simon Josefsson wrote: >> Eric Blake writes: >> >>> Since commit 4e86671a, gethostname failed to compile on mingw. >>> Gnulib's sys/socket.h includes winsock2.h, which then includes >>> unistd.h prior to declaring gethostname. The fix is to ensure >

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Eric Blake
On 03/22/2010 11:39 AM, Simon Josefsson wrote: > Eric Blake writes: > >> Since commit 4e86671a, gethostname failed to compile on mingw. >> Gnulib's sys/socket.h includes winsock2.h, which then includes >> unistd.h prior to declaring gethostname. The fix is to ensure >> that our replacement unist

Re: [PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Simon Josefsson
Eric Blake writes: > Since commit 4e86671a, gethostname failed to compile on mingw. > Gnulib's sys/socket.h includes winsock2.h, which then includes > unistd.h prior to declaring gethostname. The fix is to ensure > that our replacement unistd.h does not declare any replacements > until we are su

Fwd: [PATCH] Fix glob with empty pattern and patterns ending in slash

2010-03-22 Thread Paolo Bonzini
I think this should go in gnulib too, right? Paolo -- Forwarded message -- From: Andreas Schwab Date: Mon, Mar 22, 2010 at 16:13 Subject: [PATCH] Fix glob with empty pattern and patterns ending in slash To: libc-hac...@sourceware.org * posix/glob.c (glob): Match only directorie

[PATCHv4] gethostname: fix build on mingw

2010-03-22 Thread Eric Blake
Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname. The fix is to ensure that our replacement unistd.h does not declare any replacements until we are sure that winsock2.h is completel

Re: [PATCH] gethostname: fix build on mingw

2010-03-22 Thread Eric Blake
On 03/21/2010 01:45 PM, Matthias Bolte wrote: > 2010/3/20 Eric Blake : >> Since commit 4e86671a, gethostname failed to compile on mingw. >> Gnulib's sys/socket.h includes winsock2.h, which then includes >> unistd.h prior to declaring gethostname. Therefore, unistd.h >> cannot replace gethostname u

Re: more consistent macro naming

2010-03-22 Thread Eric Blake
On 03/21/2010 06:17 PM, Bruno Haible wrote: > Here's a proposed patch to use a name gl_FUNC_XYZ for macros that deal with > the replacement of a single function. > > Objections? > > > 2010-03-21 Bruno Haible > > * m4/getlogin.m4 (gl_FUNC_GETLOGIN): Renamed from gl_GETLOGIN. > * m

Re: port 'openpty' to all Unix platforms

2010-03-22 Thread Eric Blake
On 03/21/2010 05:10 PM, Bruno Haible wrote: > -#if HAVE_DECL_OPENPTY > +#if HAVE_OPENPTY > + > +/* Provider a wrapper with the precise POSIX prototype. */ > # undef openpty > int > -rpl_openpty (int *amaster, int *aslave, char *name, struct termios const > *termp, > - struct winsize con

Re: [PATCHv2 2/3] forkpty, openpty: split functions into new modules

2010-03-22 Thread Eric Blake
On 03/21/2010 05:56 PM, Bruno Haible wrote: > As an addendum to this patch, let's make the naming of macros more consistent: > > > 2010-03-21 Bruno Haible > > pty: Consistent macro naming. > * m4/pty_h.m4 (gl_PTY_H): Renamed from gl_PTY. > * m4/pty.m4 (gl_FORKPTY, gl_OPENPTY