Re: [PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX

2014-12-08 Thread KO Myung-Hun
Ben Pfaff wrote: > On Tue, Dec 09, 2014 at 02:51:51PM +0900, KO Myung-Hun wrote: >> Ben Pfaff wrote: >>> On Tue, Dec 09, 2014 at 10:40:48AM +0900, KO Myung-Hun wrote: UNIXROOT is used to specify a drive of a root of FHS. So if a path is started with '/', then it should be translated to

Re: [PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX

2014-12-08 Thread Ben Pfaff
On Tue, Dec 09, 2014 at 02:51:51PM +0900, KO Myung-Hun wrote: > Ben Pfaff wrote: > > On Tue, Dec 09, 2014 at 10:40:48AM +0900, KO Myung-Hun wrote: > >> UNIXROOT is used to specify a drive of a root of FHS. So if a path is > >> started with '/', then it should be translated to "$UNIXROOT/". > >> > >

Re: [PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX

2014-12-08 Thread KO Myung-Hun
Ben Pfaff wrote: > On Tue, Dec 09, 2014 at 10:40:48AM +0900, KO Myung-Hun wrote: >> UNIXROOT is used to specify a drive of a root of FHS. So if a path is >> started with '/', then it should be translated to "$UNIXROOT/". >> >> * lib/relocatable.c (relocate): Prepend $UNIXROOT to pathname if it is

Re: [PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX

2014-12-08 Thread Ben Pfaff
On Tue, Dec 09, 2014 at 10:40:48AM +0900, KO Myung-Hun wrote: > UNIXROOT is used to specify a drive of a root of FHS. So if a path is > started with '/', then it should be translated to "$UNIXROOT/". > > * lib/relocatable.c (relocate): Prepend $UNIXROOT to pathname if it is > started with '/' on E

[PATCH 12/14] save_cwd: save/restore all CWDs of each drive on EMX

2014-12-08 Thread KO Myung-Hun
On OS/2, there are maximum 26 CWDs, one CWD per drive[A to Z]. So it is needed to save and restore all of them as well as a CWD of a current drive. For examples, 1. CWD is C:\CWD 2. Call save_cwd() 3. Change drive to drive D: whose CWD was D:\ 4. Change directory to D:\CWD 5. Now, CWD i

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

2014-12-08 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 13/14] dup, dup2, fcntl: support a directory fd on OS/2 kLIBC

2014-12-08 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 08/14] wcwidth: fix 'conflicting types' error for `__wcwidth' on OS/2 kLIBC

2014-12-08 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 d7837bb..2f8dc26 100644 --- a/lib/wcwidth.c +++ b/lib/

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

2014-12-08 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 2641378..c5a4c87 100755 --- a/gnulib-tool +

[PATCH 07/14] getdtablesize: do not use getrlimit() on OS/2 kLIBC

2014-12-08 Thread KO Myung-Hun
getrlimit() implementation of kLIBC is buggy. For examples, it crashes due to 'stack overflow' or 'SIGSEGV' when used in GNU M4. So just use getdtablesize() on kLIBC. * lib/getdtablesize.c (rpl_getdtablesize): Do not use getrlimit() on OS/2 kLIBC. --- lib/getdtablesize.c | 5 + 1 file changed

[PATCH 11/14] pipe_filter_ii_execute: port to OS/2 kLIBC

2014-12-08 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 06/14] w32spawn: clear SHELL_SPECIAL_CHARS and SHELL_SPACE_CHAR on OS/2 kLIBC

2014-12-08 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 0cad232..

[PATCH 09/14] utimes: detect utimes() correctly on OS/2 kLIBC

2014-12-08 Thread KO Myung-Hun
utimes() of OS/2 kLIBC has some limitations. 1. OS/2 itself supports a file date since 1980 year. 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.m4 | 13 ++

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

2014-12-08 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 7928f8c..696cdf9 100644 --- a/lib/binary-io.h +++ b/lib/binary-io.h @@ -60,7 +60,7

[PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX

2014-12-08 Thread KO Myung-Hun
UNIXROOT is used to specify a drive of a root of FHS. So if a path is started with '/', then it should be translated to "$UNIXROOT/". * lib/relocatable.c (relocate): Prepend $UNIXROOT to pathname if it is started with '/' on EMX. --- lib/relocatable.c | 21 + 1 file changed, 2

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

2014-12-08 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 05/14] pipe-filter-aux: undefine HAVE_SELECT on KLIBC

2014-12-08 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 8f2a707..ee63ac8 100644 --- a/lib/pi

[PATCH 02/14] Fix character encoding aliases for OS/2

2014-12-08 Thread KO Myung-Hun
* lib/config.charset: Remove os2* from case "$os" in * lib/localcharset.c (get_charset_aliases): Use embedded encoding aliases on OS/2. --- lib/config.charset | 4 +--- lib/localcharset.c | 60 +- 2 files changed, 60 insertions(+), 4 deletions(-

[PATCH v2] OS/2 patches

2014-12-08 Thread KO Myung-Hun
Hi/2. These are rebased OS/2 patches. Review, please... [PATCH 01/14] stdint: check _INTPTR_T_DECLARED before defining [PATCH 02/14] Fix character encoding aliases for OS/2 [PATCH 03/14] relocatable: support UNIXROOT in relocate() on EMX [PATCH 04/14] binary-io: don't put fd in binary mode if it

Re: [PATCH 07/21] find_executable: port to EMX

2014-12-08 Thread KO Myung-Hun
Eric Blake wrote: > On 12/03/2014 03:53 PM, Bruno Haible wrote: >> KO Myung-Hun submitted: >>> 0001-find_executable-port-to-EMX.patch >> >> This patch looks fine now. Thanks. > > A couple of typos: > >>> + for specifications of DosQueryModuleName(). */ > > s/specifications/specification/

Re: [PATCH 08/21] get_shared_library_fullname: port to EMX

2014-12-08 Thread KO Myung-Hun
Eric Blake wrote: > On 12/04/2014 03:44 AM, Bruno Haible wrote: Thanks. Can you please add this URL as a comment in the patch? For future reference. >>> >>> Of course. Added. >> >> Looks good. Thanks. > >>> + for specifications of DosQueryModuleName(). */ > > another typo

Re: [libvirt] [PATCH] Define __USE_MINGW_ANSI_STDIO in config.h

2014-12-08 Thread Eric Blake
On 12/08/2014 04:14 PM, Eric Blake wrote: > where, if no fprintf module is used, then we are FORCING the system > printf format, so gcc thinks that %lld is unsupported - but at the same > time, mingw's has conditional logic that defines PRIdMAX to > "lld" instead of "I64d" when we have turned on p

Re: [libvirt] [PATCH] Define __USE_MINGW_ANSI_STDIO in config.h

2014-12-08 Thread Eric Blake
On 12/02/2014 06:50 AM, Pádraig Brady wrote: >>> >> GNULIB's 'asprintf' module detected that mingw had >>> >> the asprintf function, but didn't define the >>> >> __USE_MINGW_ANSI_STDIO so we got left with the version >>> >> offering Win32 format specifiers, instead of GNU formats. >>> >> >>> >> It

Re: [PATCH 05/21] spawn: do not include sched.h on OS/2 kLIBC

2014-12-08 Thread Eric Blake
On 12/04/2014 03:42 AM, Bruno Haible wrote: >> Like this ? >> 0001-sched-check-struct-sched_param-in-spawn.h-as-well.patch > > Yes. This looks perfect now. Thanks! I've pushed this one. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org sig

Re: [PATCH v3] bootstrap: Allow perl modules in $buildreq

2014-12-08 Thread Eric Blake
On 12/08/2014 05:19 AM, Martin Kletzander wrote: > With this patch it is possible to put e.g. "perl::XML:XPath -" in > $buildreq in bootstrap.conf which will cause a check for perl module > XML::XPath using: > > perl -m"XML::XPath" -e 'exit 0' >/dev/null 2>&1 > > If this fails due to any other

Re: [libvirt] [PATCH] Define __USE_MINGW_ANSI_STDIO in config.h

2014-12-08 Thread Eric Blake
On 12/08/2014 02:15 PM, Eric Blake wrote: > On 12/08/2014 02:10 PM, Pádraig Brady wrote: >> This was pushed (I think inadvertently). > > No, it was intentional, done by me with an explanation mail. But it > looks like the GNU mail servers are eating my gpg-signed mails (again - > I thought we had

Re: [libvirt] [PATCH] Define __USE_MINGW_ANSI_STDIO in config.h

2014-12-08 Thread Eric Blake
On 12/02/2014 06:50 AM, Pádraig Brady wrote: >>> It could perhaps be argued that gnulib's 'asprintf' >>> could be defining __USE_MINGW_ANSI_STDIO for us ? >> >> Yes, gnulib should be taking advantage of this new mingw development. > > I independently noticed this mingw feature when looking at the

Re: [libvirt] [PATCH] Define __USE_MINGW_ANSI_STDIO in config.h

2014-12-08 Thread Eric Blake
On 12/08/2014 02:10 PM, Pádraig Brady wrote: > This was pushed (I think inadvertently). No, it was intentional, done by me with an explanation mail. But it looks like the GNU mail servers are eating my gpg-signed mails (again - I thought we had fixed it a couple weeks ago, but it appears to have r

Re: [PATCH 07/21] find_executable: port to EMX

2014-12-08 Thread Eric Blake
On 12/03/2014 03:53 PM, Bruno Haible wrote: > KO Myung-Hun submitted: >> 0001-find_executable-port-to-EMX.patch > > This patch looks fine now. Thanks. A couple of typos: >> + for specifications of DosQueryModuleName(). */ s/specifications/specification/ (appeared twice). I added a ChangeL

Re: [libvirt] [PATCH] Define __USE_MINGW_ANSI_STDIO in config.h

2014-12-08 Thread Pádraig Brady
This was pushed (I think inadvertently). I needed to update the docs before pushing, and so wanted to run on mingw64 to find which cases exactly were covered. The logic at least should be Ok I think. thanks, Pádraig

Re: [PATCH v3] bootstrap: Allow perl modules in $buildreq

2014-12-08 Thread Pádraig Brady
LGTM. Pushed. thanks, Pádraig

Re: [PATCH 15/21] freopen: workaround freopen() on OS/2 kLIBC

2014-12-08 Thread Eric Blake
On 12/05/2014 02:53 AM, Bruno Haible wrote: > KO Myung-Hun wrote: >> I also don't want to break the convention. >> >> Fixed. > > Thanks. This looks perfect now. Pushed -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Descrip

Re: [PATCH 08/21] get_shared_library_fullname: port to EMX

2014-12-08 Thread Eric Blake
On 12/04/2014 03:44 AM, Bruno Haible wrote: >>> Thanks. Can you please add this URL as a comment in the patch? For future >>> reference. >> >> Of course. Added. > > Looks good. Thanks. >> + for specifications of DosQueryModuleName(). */ another typo fix; amended and pushed. At this po

Re: [PATCH] vasnprintf: fix potential use after free

2014-12-08 Thread Paul Eggert
On 12/08/2014 07:24 AM, Eric Blake wrote: It might make sense to have a variant of 'free' that preserves errno, >but we should probably give the variant a different name. 'noerr_free', >say. I'm not sure a variant is needed; if we can get glibc to guarantee the POSIX proposal now, then we would

Re: [PATCH] vasnprintf: fix potential use after free

2014-12-08 Thread Eric Blake
On 12/07/2014 07:29 PM, Paul Eggert wrote: > Pádraig Brady wrote: >> BTW if free() may reset errno on some platforms then it's >> probably worth augmenting the gnulib free() wrapper >> to restore errno if needed, > > The documented GNU behavior for 'free' allows 'free' to set errno, > right? So w

[PATCH v3] bootstrap: Allow perl modules in $buildreq

2014-12-08 Thread Martin Kletzander
With this patch it is possible to put e.g. "perl::XML:XPath -" in $buildreq in bootstrap.conf which will cause a check for perl module XML::XPath using: perl -m"XML::XPath" -e 'exit 0' >/dev/null 2>&1 If this fails due to any other error then XML::XPath missing, it is left on the user to fix up

[PATCH v2] bootstrap: Allow perl modules in $buildreq

2014-12-08 Thread Martin Kletzander
With this patch it is possible to put e.g. "perl::XML:XPath -" in $buildreq in bootstrap.conf which will cause a check for perl module XML::XPath using: perl -m"XML::XPath" -e 'exit 0' >/dev/null 2>&1 If this fails due to any other error then XML::XPath missing, it is left on the user to fix up

Re: [PATCH] bootstrap: Allow perl modules in $buildreq

2014-12-08 Thread Martin Kletzander
On Mon, Dec 08, 2014 at 11:00:37AM +, Pádraig Brady wrote: On 08/12/14 10:42, Martin Kletzander wrote: With this patch it is possible to put e.g. "perl::XML:XPath -" in $buildreq in bootstrap.conf which will cause a check for perl module XML::XPath looks useful... perl -m"XML::XPath" -

Re: [PATCH] bootstrap: Allow perl modules in $buildreq

2014-12-08 Thread Pádraig Brady
On 08/12/14 10:42, Martin Kletzander wrote: > With this patch it is possible to put e.g. "perl::XML:XPath -" in > $buildreq in bootstrap.conf which will cause a check for perl module > XML::XPath looks useful... > perl -m"XML::XPath" -e 'exit 0' >/dev/null 2>&1 > > If this fails due to any oth

[PATCH] bootstrap: Allow perl modules in $buildreq

2014-12-08 Thread Martin Kletzander
With this patch it is possible to put e.g. "perl::XML:XPath -" in $buildreq in bootstrap.conf which will cause a check for perl module XML::XPath using: perl -m"XML::XPath" -e 'exit 0' >/dev/null 2>&1 If this fails due to any other error then XML::XPath missing, it is left on the user to fix up

Re: [PATCH] vasnprintf: fix potential use after free

2014-12-08 Thread Pádraig Brady
On 08/12/14 02:29, Paul Eggert wrote: > Pádraig Brady wrote: >> BTW if free() may reset errno on some platforms then it's >> probably worth augmenting the gnulib free() wrapper >> to restore errno if needed, > > The documented GNU behavior for 'free' allows 'free' to set errno, right? So > why s