This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU libidn".
http://git.savannah.gnu.org/cgit/libidn.git/commit/?id=528faf36737055a6867e8090bb7add610115eab4 The branch, master has been updated via 528faf36737055a6867e8090bb7add610115eab4 (commit) via 64b0593ec685a43f4e306818c9b5407bad7b12dd (commit) from c18c6ce34bcf6555fd3019e062220291e898a198 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 528faf36737055a6867e8090bb7add610115eab4 Author: Simon Josefsson <[email protected]> Date: Tue Jan 12 12:14:16 2010 +0100 Add workaround for Wine open failure. commit 64b0593ec685a43f4e306818c9b5407bad7b12dd Author: Simon Josefsson <[email protected]> Date: Tue Jan 12 12:28:08 2010 +0100 Add workaround for Wine dup2 failure. ----------------------------------------------------------------------- Summary of changes: gl/m4/open.m4 | 18 ++++++++++-------- gl/override/m4/open.m4.diff | 34 ++++++++++++++++++++++++++++++++++ gl/override/tests/dup2.c.diff | 40 ++++++++++++++++++++++++++++++++++++++++ gltests/dup2.c | 15 +++++++++++++++ 4 files changed, 99 insertions(+), 8 deletions(-) create mode 100644 gl/override/m4/open.m4.diff create mode 100644 gl/override/tests/dup2.c.diff diff --git a/gl/m4/open.m4 b/gl/m4/open.m4 index d705b3a..63ab918 100644 --- a/gl/m4/open.m4 +++ b/gl/m4/open.m4 @@ -9,7 +9,9 @@ AC_DEFUN([gl_FUNC_OPEN], AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in mingw* | pw*) - gl_REPLACE_OPEN + # The misbehaviour is only under Wine, see + # http://bugs.winehq.org/show_bug.cgi?id=21292 + gl_cv_func_open_slash=no ;; *) dnl open("foo/") should not create a file when the file name has a @@ -46,13 +48,13 @@ changequote([,])dnl ]) rm -f conftest.sl conftest.tmp conftest.lnk ]) - case "$gl_cv_func_open_slash" in - *no) - AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], - [Define to 1 if open() fails to recognize a trailing slash.]) - gl_REPLACE_OPEN - ;; - esac + ;; + esac + case "$gl_cv_func_open_slash" in + *no) + AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], + [Define to 1 if open() fails to recognize a trailing slash.]) + gl_REPLACE_OPEN ;; esac ]) diff --git a/gl/override/m4/open.m4.diff b/gl/override/m4/open.m4.diff new file mode 100644 index 0000000..1ea367f --- /dev/null +++ b/gl/override/m4/open.m4.diff @@ -0,0 +1,34 @@ +--- gl/m4/open.m4.orig 2010-01-12 12:13:11.000000000 +0100 ++++ gl/m4/open.m4 2010-01-12 12:13:20.000000000 +0100 +@@ -9,7 +9,9 @@ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw* | pw*) +- gl_REPLACE_OPEN ++ # The misbehaviour is only under Wine, see ++ # http://bugs.winehq.org/show_bug.cgi?id=21292 ++ gl_cv_func_open_slash=no + ;; + *) + dnl open("foo/") should not create a file when the file name has a +@@ -46,13 +48,13 @@ + ]) + rm -f conftest.sl conftest.tmp conftest.lnk + ]) +- case "$gl_cv_func_open_slash" in +- *no) +- AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], +- [Define to 1 if open() fails to recognize a trailing slash.]) +- gl_REPLACE_OPEN +- ;; +- esac ++ ;; ++ esac ++ case "$gl_cv_func_open_slash" in ++ *no) ++ AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], ++ [Define to 1 if open() fails to recognize a trailing slash.]) ++ gl_REPLACE_OPEN + ;; + esac + ]) diff --git a/gl/override/tests/dup2.c.diff b/gl/override/tests/dup2.c.diff new file mode 100644 index 0000000..e48354d --- /dev/null +++ b/gl/override/tests/dup2.c.diff @@ -0,0 +1,40 @@ +diff --git a/gltests/dup2.c b/gltests/dup2.c +index a4422bf..b9b329c 100644 +--- a/gltests/dup2.c ++++ b/gltests/dup2.c +@@ -40,6 +40,7 @@ rpl_dup2 (int fd, int desired_fd) + { + int result; + # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ ++ int fd_mode = -1; + /* If fd is closed, mingw hangs on dup2 (fd, fd). If fd is open, + dup2 (fd, fd) returns 0, but all further attempts to use fd in + future dup2 calls will hang. */ +@@ -59,6 +60,14 @@ rpl_dup2 (int fd, int desired_fd) + errno = EBADF; + return -1; + } ++ /* Wine 1.0.1 puts desired_fd into binary mode when fd is in text ++ mode, so we save the old mode here. ++ http://bugs.winehq.org/show_bug.cgi?id=21291 */ ++ if ((HANDLE) _get_osfhandle (fd) != (HANDLE) -1) ++ { ++ fd_mode = setmode (fd, O_BINARY); ++ setmode (fd, fd_mode); ++ } + # endif + result = dup2 (fd, desired_fd); + # ifdef __linux__ +@@ -80,6 +89,12 @@ rpl_dup2 (int fd, int desired_fd) + if (fd != desired_fd && result != -1) + result = _gl_register_dup (fd, result); + # endif ++# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ ++ /* Restore text mode if needed. ++ http://bugs.winehq.org/show_bug.cgi?id=21291 */ ++ if (result != -1 && fd_mode != -1) ++ setmode (desired_fd, fd_mode); ++# endif + return result; + } + diff --git a/gltests/dup2.c b/gltests/dup2.c index a4422bf..b9b329c 100644 --- a/gltests/dup2.c +++ b/gltests/dup2.c @@ -40,6 +40,7 @@ rpl_dup2 (int fd, int desired_fd) { int result; # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + int fd_mode = -1; /* If fd is closed, mingw hangs on dup2 (fd, fd). If fd is open, dup2 (fd, fd) returns 0, but all further attempts to use fd in future dup2 calls will hang. */ @@ -59,6 +60,14 @@ rpl_dup2 (int fd, int desired_fd) errno = EBADF; return -1; } + /* Wine 1.0.1 puts desired_fd into binary mode when fd is in text + mode, so we save the old mode here. + http://bugs.winehq.org/show_bug.cgi?id=21291 */ + if ((HANDLE) _get_osfhandle (fd) != (HANDLE) -1) + { + fd_mode = setmode (fd, O_BINARY); + setmode (fd, fd_mode); + } # endif result = dup2 (fd, desired_fd); # ifdef __linux__ @@ -80,6 +89,12 @@ rpl_dup2 (int fd, int desired_fd) if (fd != desired_fd && result != -1) result = _gl_register_dup (fd, result); # endif +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* Restore text mode if needed. + http://bugs.winehq.org/show_bug.cgi?id=21291 */ + if (result != -1 && fd_mode != -1) + setmode (desired_fd, fd_mode); +# endif return result; } hooks/post-receive -- GNU libidn _______________________________________________ Libidn-commit mailing list [email protected] http://lists.gnu.org/mailman/listinfo/libidn-commit
