[PATCH] string: fix build failure on BSD/OSX with FORTIFY_SOURCE

2015-05-27 Thread Pádraig Brady
This avoids a conflict with "FORTIFY_SOURCE" variants of the string functions when they're replaced on NetBSD-6.0.1 and Darwin-14.3.0 at least. On these platforms, the system re-includes "string.h" through , before going on to redefine the "FORTIFY_SOURCE" _chk variants. For example rpl_strncat i

[PATCH 08/12] dup, dup2, fcntl: support a directory fd on OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
On OS/2 kLIBC, dup(), dup2() and fcntl() do not work on a directory fd. * lib/dup.c (dup_nothrow): New. * lib/dup2.c (klibc_dup2dirfd): New. dup2() for a directory fd. (klibc_dup2): New. * lib/fcntl.c (klibc_fcntl): New. * m4/dup.m4 (gl_FUNC_DUP): Check if dup() works on a directory fd. * m4/dup2.

[PATCH 03/12] pipe-filter-aux: undefine HAVE_SELECT on KLIBC

2015-05-27 Thread KO Myung-Hun
On OS/2 kLIBC, select() works only on sockets. * lib/pipe-filter-aux.h (HAVE_SELECT): Undefine on OS/2 kLIBC. --- lib/pipe-filter-aux.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pipe-filter-aux.h b/lib/pipe-filter-aux.h index 132cc54..ac11be7 100644 --- a/lib/pi

[PATCH 07/12] pipe_filter_ii_execute: port to OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
Pipes on kLIBC does not support O_NONBLOCK like Win32. * lib/pipe-filter-ii.c (start_wrapper, _beginthreadex, CloseHandle, WaiForSingleObject, WaitForMultipleObjects): New on OS/2 kLIBC. Reuse Win32 codes on OS/2 kLIBC. * lib/spawn-pipe.c: Reuse Win32 codes on OS/2 kLIBC. * lib/w32spawn.h: Do not

[PATCH 05/12] wcwidth: fix 'conflicting types' error for `__wcwidth' on OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
wchar_t(unsigned short) is defined differently from wint_t(int) on OS/2 kLIBC. * lib/wcwidth.c (wcwidth): Undefine on OS/2 kLIBC. --- lib/wcwidth.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/wcwidth.c b/lib/wcwidth.c index d2b7118..e398f30 100644 --- a/lib/wcwidth.c +++ b/lib/

[PATCH 04/12] w32spawn: clear SHELL_SPECIAL_CHARS and SHELL_SPACE_CHAR on OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
spawn() on OS/2 kLIBC is not silly like one on Windows * libc/w32spawn.h (SHELL_SPECIAL_CHARS, SHELL_SPACE_CHAR): Set both to empty string on OS/2 kLIBC. --- lib/w32spawn.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/w32spawn.h b/lib/w32spawn.h index 4a21a4e..

[PATCH 12/12] openat_proc_name: port to OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
OS/2 kLIBC provides a function to retrive a path from a fd. Use it instead of /proc/self/fd. * lib/openat-proc.c (openat_proc_name): Port to OS/2 kLIBC with __libc_Back_ioFHToPath(). --- lib/openat-proc.c | 29 + 1 file changed, 29 insertions(+) diff --git a/lib/opena

[PATCH 11/12] utimes: detect utimes() correctly on OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
utimes() of OS/2 kLIBC has some limitations. 1. OS/2 itself supports a file date since 1980 year in local time. 2. OS/2 itself supports even seconds for a file time. 3. utimes() of OS/2 kLIBC does not work on an opened file. * m4/utimes.m4: Detect utimes() correctly on OS/2 kLIBC. --- m4/utimes.

[PATCH 09/12] opendir, closedir, dirfd, fdopendir: port to OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
* lib/closedir.c (closedir): Unregister fd if closedir() succeeds. * lib/dirent.in.h (_gl_register_dirp_fd, _gl_unregister_dirp_fd): Declare on kLIBC. * lib/dirfd.c (struct dirp_fd_list): New. Structures to keep track of fd associated with dirp. (_gl_register_dirp_fd): New. Register fd associated w

[PATCH 02/12] binary-io: don't put fd in binary mode if it is a console on EMX

2015-05-27 Thread KO Myung-Hun
* lib/binary-io.h (SET_BINARY): Don't put fd in binary mode if it is a console on EMX. --- lib/binary-io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/binary-io.h b/lib/binary-io.h index f5b66c7..380ae98 100644 --- a/lib/binary-io.h +++ b/lib/binary-io.h @@ -60,7 +60,7

[PATCH 10/12] configmake: prepend /@unixroot on OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
/@unixroot is replaced by $UNIXROOT, which points a drive on which programs following FHS are installed. This enables a program to find a proper directory even if it is executed on a differrent drive from the drive on which it is installed. For examples, consider a program package installed on f:

[PATCH 06/12] gnulib-tool: fall back into copy if symbolic link is not supported

2015-05-27 Thread KO Myung-Hun
And warn about it. * gnulib-tool (have_symlink_support): New. (symbolic, lsymbolic): Clear on systems not supporting symbolic link. --- gnulib-tool | 20 1 file changed, 20 insertions(+) diff --git a/gnulib-tool b/gnulib-tool index 303df53..ce145cb 100755 --- a/gnulib-tool +

[PATCH 01/12] stdint: check _INTPTR_T_DECLARED before defining intptr_t and uintptr_t

2015-05-27 Thread KO Myung-Hun
OS/2 kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own definitions of intptr_t and uintptr_t (which use int and unsigned) to avoid clashes with declarations of system functions like sbrk. * lib/stdint.in.h (intptr_t, uintptr_t): Check _INTPTR_T_DECLARED before defining them. --- lib/s

[PATCH] OS/2 patches

2015-05-27 Thread KO Myung-Hun
Hi/2. These are OS/2 patches rebased latest master. Review, please... [PATCH 01/12] stdint: check _INTPTR_T_DECLARED before defining [PATCH 02/12] binary-io: don't put fd in binary mode if it is a [PATCH 03/12] pipe-filter-aux: undefine HAVE_SELECT on KLIBC [PATCH 04/12] w32spawn: clear SHELL_SP

Re: [PATCH 06/12] gnulib-tool: fall back into copy if symbolic link is not supported

2015-05-27 Thread Pádraig Brady
On 27/05/15 13:45, KO Myung-Hun wrote: > And warn about it. > > * gnulib-tool (have_symlink_support): New. > (symbolic, lsymbolic): Clear on systems not supporting symbolic link. > --- > gnulib-tool | 20 > 1 file changed, 20 insertions(+) > > diff --git a/gnulib-tool b/gnul

Re: [PATCH 06/12] gnulib-tool: fall back into copy if symbolic link is not supported

2015-05-27 Thread KO Myung-Hun
Pádraig Brady wrote: > On 27/05/15 13:45, KO Myung-Hun wrote: >> And warn about it. >> >> * gnulib-tool (have_symlink_support): New. >> (symbolic, lsymbolic): Clear on systems not supporting symbolic link. >> --- >> gnulib-tool | 20 >> 1 file changed, 20 insertions(+) >> >>

Re: [PATCH 06/12] gnulib-tool: fall back into copy if symbolic link is not supported

2015-05-27 Thread Eric Blake
On 05/27/2015 07:44 AM, KO Myung-Hun wrote: >>> func_exit 1 >>>fi >>> + # Warn if symbolic link is requested on a system not supporting it. >>> + # And fall back into copy. >>> + if { test -n "$symbolic" || test -n "$lsymbolic" ; } \ >>> + && ! $have_symlink_support ; then >> >> !

Re: [PATCH 06/12] gnulib-tool: fall back into copy if symbolic link is not supported

2015-05-27 Thread Pádraig Brady
On 27/05/15 15:03, Eric Blake wrote: > On 05/27/2015 07:44 AM, KO Myung-Hun wrote: > func_exit 1 fi + # Warn if symbolic link is requested on a system not supporting it. + # And fall back into copy. + if { test -n "$symbolic" || test -n "$lsymbolic" ; } \ +

Re: [PATCH 01/12] stdint: check _INTPTR_T_DECLARED before defining intptr_t and uintptr_t

2015-05-27 Thread Paul Eggert
KO Myung-Hun wrote: +/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own + definitions of intptr_t and uintptr_t (which use int and unsigned) + to avoid clashes with declarations of system functions like sbrk. */ +#ifndef _INTPTR_T_DECLARED +# undef intptr_t +# undef uintptr_t

Re: [PATCH 06/12] gnulib-tool: fall back into copy if symbolic link is not supported

2015-05-27 Thread Paul Eggert
KO Myung-Hun wrote: +# Check if symbolic link is supported +have_symlink_support=false +rm -f symlink$$.file symlink$$ +if (echo >symlink$$.file) 2>/dev/null; then + if ln -s symlink$$.file symlink$$ 2>/dev/null; then +have_symlink_support=true + fi +fi +rm -f symlink$$.file symlink$$ Th

Re: [PATCH 09/12] opendir, closedir, dirfd, fdopendir: port to OS/2 kLIBC

2015-05-27 Thread Paul Eggert
KO Myung-Hun wrote: -# if REPLACE_FCHDIR +# if REPLACE_FCHDIR || defined __KLIBC__ int fd = dirfd (dirp); # endif Would it be cleaner to change that "defined __KLIBC__" to "REPLACE_DIRFD"?

Re: [PATCH 11/12] utimes: detect utimes() correctly on OS/2 kLIBC

2015-05-27 Thread Paul Eggert
KO Myung-Hun wrote: +/* utimes() of OS/2 kLIBC does not work on an opened file */ +else if (close (fd) != 0) + result |= 1; This limitation of should be documented in doc/posix-functions/utimes.texi, presumably as an OS/2 deficiency that Gnulib doesn't work around. Al

Re: [PATCH 10/12] configmake: prepend /@unixroot on OS/2 kLIBC

2015-05-27 Thread Paul Eggert
KO Myung-Hun wrote: + echo '#ifdef __KLIBC__'; \ + echo '# define UNIXROOT "/@unixroot"'; \ + echo '#else'; \ + echo '# define UNIXROOT ""'; \ + echo '#endif'; \ + echo '#define PREFIX UNIXROOT "$(prefix)"'; \ + echo '#define EXEC_PREFIX

Re: [GNULIB v2 1/2] file-has-acl: Split feature tests again

2015-05-27 Thread Paul Eggert
I found one nit: +AC_CHECK_HEADERS([linux/xattr.h]) +AC_CHECK_HEADERS([sys/xattr.h], + [AC_CHECK_FUNCS_ONCE([getxattr])]) This is missing _ONCE and non-ONCE calls, which doesn't work as expected. Simplest fix is to replace AC_CHECK_FUNCS_ONCE with AC_CHECK_FUNCS.

Re: [GNULIB v2 1/2] file-has-acl: Split feature tests again

2015-05-27 Thread Andreas Grünbacher
Paul, 2015-05-27 20:14 GMT+02:00 Paul Eggert : > Simplest fix is to replace AC_CHECK_FUNCS_ONCE with AC_CHECK_FUNCS. thanks, I've fixed that on github. Andreas

Re: [GNULIB v2 2/2] qacl: Reimplement qset_acl and qcopy_acl

2015-05-27 Thread Paul Eggert
On 05/26/2015 01:53 PM, Andreas Gruenbacher wrote: --- lib/acl-internal.c| 30 ++ This one is missing a patch to ChangeLog. Please put the commit message into the ChangeLog. Also, please put the string "Bug#20666" somewhere into the commit message body and the ChangeLog (they should

Re: [GNULIB v2 2/2] qacl: Reimplement qset_acl and qcopy_acl

2015-05-27 Thread Andreas Grünbacher
Paul, requested changes made and pushed. I don't think I have commit access to coreutils, so could you please push the coreutils change to update gnulib (attached)? Thanks, Andreas From 0f9db36d658b9cb8933f334109c6e0a8a72c5160 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Sat, 11 Apr

Re: [PATCH 10/12] configmake: prepend /@unixroot on OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
Hi/2. Paul Eggert wrote: > KO Myung-Hun wrote: > >> + echo '#ifdef __KLIBC__'; \ >> + echo '# define UNIXROOT "/@unixroot"'; \ >> + echo '#else'; \ >> + echo '# define UNIXROOT ""'; \ >> + echo '#endif'; \ >> + echo '#define PREFIX UNIXROOT "$(prefix)"'; \ >> +

Re: [PATCH 09/12] opendir, closedir, dirfd, fdopendir: port to OS/2 kLIBC

2015-05-27 Thread KO Myung-Hun
Hi/2. Paul Eggert wrote: > KO Myung-Hun wrote: >> -# if REPLACE_FCHDIR >> +# if REPLACE_FCHDIR || defined __KLIBC__ >> int fd = dirfd (dirp); >> # endif > > Would it be cleaner to change that "defined __KLIBC__" to "REPLACE_DIRFD"? Fixed. -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Un

[PATCH] qacl: split into qcopy-acl and qset-acl

2015-05-27 Thread Paul Eggert
Emacs needs the former, but not the latter. * modules/acl-permissions: New file, containing most of the old qacl. * modules/file-has-acl (Depends-on): Depend on acl-permissions, not qacl. * modules/qacl: Now merely depends on qcopy-acl and qset-acl. * modules/qcopy-acl, modules/qset-acl: New files.

Re: [PATCH 01/12] stdint: check _INTPTR_T_DECLARED before defining intptr_t and uintptr_t

2015-05-27 Thread KO Myung-Hun
Hi/2. Paul Eggert wrote: > KO Myung-Hun wrote: > >> +/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own >> + definitions of intptr_t and uintptr_t (which use int and unsigned) >> + to avoid clashes with declarations of system functions like sbrk. */ >> +#ifndef _INTPTR_T_DECLAR