dup2: Make code more maintainable.
[gnulib.git] / ChangeLog
index 9054e98..74677b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,238 @@
+2011-09-23  Bruno Haible  <bruno@clisp.org>
+
+       dup2: Make code more maintainable.
+       * lib/dup2.c (dup2_nothrow): New function, extracted from rpl_dup2.
+       (rpl_dup2): Use it.
+       * m4/dup2.m4 (gl_PREREQ_DUP2): New macro.
+       * modules/dup2 (configure.ac): Invoke it.
+       Reported by Paul Eggert.
+
+2011-09-23  Bruno Haible  <bruno@clisp.org>
+
+       msvc-inval: Fix compilation error.
+       * lib/msvc-inval.h: Include <excpt.h>.
+
+2011-09-23  Bruno Haible  <bruno@clisp.org>
+
+       mkdir: Tweak for MSVC 9.
+       * lib/sys_stat.in.h: Update comments.
+       * doc/posix-functions/mkdir.texi: Mention problem on MSVC 9.
+
+       Tests for module 'chdir'.
+       * modules/chdir-tests: New file.
+       * tests/test-chdir.c: New file.
+
+       New module 'chdir'.
+       * modules/chdir: New file.
+       * lib/unistd.in.h: Include <io.h>, <direct.h> also for chdir.
+       (chdir): New declaration.
+       * m4/unistd_h.m4 (gl_UNISTD_H): Test whether chdir is declared.
+       (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_CHDIR.
+       * modules/unistd (Makefile.am): Substitute GNULIB_CHDIR.
+       * tests/test-unistd-c++.cc: Check signature of chdir.
+       * doc/posix-functions/chdir.texi: Mention problem on native Windows.
+       * modules/chdir-long (Depends-on): Add chdir.
+       * modules/fchdir (Depends-on): Likewise.
+       * modules/rename (Depends-on): Likewise.
+       * modules/savewd (Depends-on): Likewise.
+
+       rmdir: Support for mingw, MSVC 9.
+       * lib/unistd.in.h: Include <io.h> and <direct.h> also for rmdir.
+       * doc/posix-functions/getcwd.texi: Mention problem on native Windows.
+
+       getcwd: Tweak for MSVC 9.
+       * lib/unistd.in.h: Update comments.
+       * doc/posix-functions/getcwd.texi: Mention problem on MSVC 9.
+
+2011-09-22  Bruno Haible  <bruno@clisp.org>
+
+       strerror_r-posix: Avoid a link error on MSVC.
+       * m4/strerror_r.m4 (gl_PREREQ_STRERROR_R): Check for snprintf.
+       * lib/strerror_r.c (snprintf): Define to _snprintf if it doesn't exist.
+
+2011-09-22  Bruno Haible  <bruno@clisp.org>
+
+       select: Avoid link errors on MSVC.
+       * m4/select.m4 (gl_FUNC_SELECT): Determine LIB_SELECT.
+       * modules/select (Link): Replace $(LIBSOCKET) with $(LIB_SELECT).
+       * modules/pselect (Link): Likewise.
+       * NEWS: Mention the change.
+       * modules/select-tests (Makefile.am): Link test-select, test-select-fd,
+       test-select-stdin against $(LIB_SELECT).
+       * modules/pselect-tests (Makefile.am): Link test-pselect against
+       $(LIB_SELECT).
+
+2011-09-22  Bruno Haible  <bruno@clisp.org>
+
+       select: Avoid compilation error on MSVC.
+       * lib/select.c: Don't include <stdbool.h>.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       Consolidate all uses of PATH_MAX in *.m4 files.
+       * m4/pathmax.m4 (gl_PATHMAX_SNIPPET, gl_PATHMAX_SNIPPET_PREREQ): New
+       macros.
+       * m4/chdir-long.m4 (gl_FUNC_CHDIR_LONG): Use gl_PATHMAX_SNIPPET_PREREQ
+       and gl_PATHMAX_SNIPPET.
+       * m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Likewise.
+       * m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
+       * modules/chdir-long (Files): Add m4/pathmax.m4.
+       * modules/getcwd (Files): Likewise.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       ftruncate: Un-deprecate, concentrate on Win32 support.
+       * modules/ftruncate (Status, Notice): Remove sections.
+       (Depends-on): Add largefile.
+       * m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Drop failure message on
+       non-mingw platforms.
+       * lib/ftruncate.c: Remove code for the older platforms. For Win32,
+       include <io.h>.
+       * modules/perror-tests (Depends-on): Add ftruncate.
+       * doc/posix-functions/ftruncate.texi: Mention the MSVC problem and the
+       'ftruncate' module.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       Add dependencies to new dirent related modules.
+       * modules/opendir (Depends-on): Add closedir.
+       * modules/getcwd (Depends-on): Add opendir, closedir.
+       * modules/dirent-safer-tests (Depends-on): Likewise.
+       * modules/fdopendir-tests (Depends-on): Likewise.
+       * modules/rename-tests (Depends-on): Add opendir, readdir, closedir.
+       * modules/renameat-tests (Depends-on): Likewise.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       opendir: Avoid compilation error on mingw.
+       * lib/opendir.c: Include <stddef.h> always. Include <unistd.h> as well.
+       * modules/opendir (Depends-on): Add unistd.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       ftruncate tests: Avoid a test failure on mingw.
+       * tests/test-ftruncate.c (main): Allow a failure with EACCES.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       select tests: Avoid test failures on OSF/1 5.1 and mingw.
+       * tests/test-select.h (test_bad_fd): Disable all tests on OSF/1 and
+       native Windows.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       New module 'fdopen'.
+       * lib/stdio.in.h (fdopen): New declaration.
+       * lib/fdopen.c: New file.
+       * m4/fdopen.m4: New file.
+       * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize GNULIB_FDOPEN,
+       REPLACE_FDOPEN.
+       * modules/stdio (Makefile.am): Substitute GNULIB_FDOPEN,
+       REPLACE_FDOPEN.
+       * modules/fdopen: New file.
+       * modules/stdio-tests (Depends-on): Remove fdopen-tests.
+       * tests/test-stdio-c++.cc: Check signature of fdopen.
+       * doc/posix-functions/fdopen.texi: Mention the new module.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       unlockpt tests: Avoid test failure on NetBSD 5.1.
+       * tests/test-unlockpt.c (main): Skip the EBADF tests on NetBSD.
+       * doc/posix-functions/unlockpt.texi: Mention the bug on NetBSD.
+
+2011-09-21  Bruno Haible  <bruno@clisp.org>
+
+       getlogin, getlogin_r tests: Avoid test failure on Linux/SPARC.
+       * tests/test-getlogin.c (main): Allow a failure with EINVAL.
+       * tests/test-getlogin_r.c (main): Likewise.
+
+2011-09-20  Bruno Haible  <bruno@clisp.org>
+
+       time tests: Don't require pid_t.
+       * doc/posix-headers/time.texi: Revert last change.
+       * m4/time_h.m4 (gl_HEADER_TIME_H_BODY): Revert last change.
+       * tests/test-time.c: Comment out the check for pid_t.
+
+2011-09-20  Bruno Haible  <bruno@clisp.org>
+
+       fsync tests: Avoid a test failure on mingw.
+       * tests/test-fsync.c (main): Allow a failure with EIO.
+
+2011-09-20  Bruno Haible  <bruno@clisp.org>
+
+       euidaccess: Update comments.
+       * m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Update comments.
+
+2011-09-20  Bruno Haible  <bruno@clisp.org>
+
+       Ensure EBADF returns for socket functions on mingw.
+       * lib/accept.c (rpl_accept): Fail with error EBADF if the file
+       descriptor is invalid.
+       * lib/bind.c (rpl_bind): Likewise.
+       * lib/connect.c (rpl_connect): Likewise.
+       * lib/getpeername.c (rpl_getpeername): Likewise.
+       * lib/getsockname.c (rpl_getsockname): Likewise.
+       * lib/getsockopt.c (rpl_getsockopt): Likewise.
+       * lib/listen.c (rpl_listen): Likewise.
+       * lib/recv.c (rpl_recv): Likewise.
+       * lib/recvfrom.c (rpl_recvfrom): Likewise.
+       * lib/send.c (rpl_send): Likewise.
+       * lib/sendto.c (rpl_sendto): Likewise.
+       * lib/setsockopt.c (rpl_setsockopt): Likewise.
+       * lib/shutdown.c (rpl_shutdown): Likewise.
+
 2011-09-20  Bruno Haible  <bruno@clisp.org>
 
+       select tests: EBADF tests.
+       * tests/test-select.h (do_select_bad_fd, do_select_bad_fd_nowait,
+       test_bad_fd): New functions.
+       (test_function): Invoke also test_bad_fd.
+
+2011-09-20  Bruno Haible  <bruno@clisp.org>
+
+       Tests for module 'posix_spawn_file_actions_addopen.
+       * modules/posix_spawn_file_actions_addopen-tests: New file.
+       * tests/test-posix_spawn_file_actions_addopen.c: New file.
+
+       Tests for module 'posix_spawn_file_actions_adddup2'.
+       * modules/posix_spawn_file_actions_adddup2-tests: New file.
+       * tests/test-posix_spawn_file_actions_adddup2.c: New file.
+
+       Tests for module 'posix_spawn_file_actions_addclose'.
+       * modules/posix_spawn_file_actions_addclose-tests: New file.
+       * tests/test-posix_spawn_file_actions_addclose.c: New file.
+
+2011-09-20  Bruno Haible  <bruno@clisp.org>
+
+       Tests for module 'unlockpt'.
+       * modules/unlockpt-tests: New file.
+       * tests/test-unlockpt.c: New file.
+       * doc/posix-functions/unlockpt.texi: Mention the Cygwin 1.7 problem.
+
+       Tests for module 'grantpt'.
+       * modules/grantpt-tests: New file.
+       * tests/test-grantpt.c: New file.
+       * doc/posix-functions/grantpt.texi: Mention the Cygwin 1.7 problem.
+
+2011-09-20  Bruno Haible  <bruno@clisp.org>
+
+       freopen tests: EBADF tests.
+       * tests/test-freopen.c: Include errno.h, unistd.h.
+       (main): Add tests for EBADF, commented out for the moment.
+
+       fclose tests: EBADF tests.
+       * tests/test-fclose.c (main): Add tests for EBADF.
+
+       fflush tests: EBADF tests.
+       * tests/test-fflush.c: Include errno.h, macros.h.
+       (main): Add tests for EBADF.
+
+       ftello tests: EBADF tests.
+       * tests/test-ftello4.sh: New file.
+       * tests/test-ftello4.c: New file.
+       * modules/ftello-tests (Files): Add them.
+       (Makefile.am): Arrange to compile test-ftello4 and run test-ftello4.sh.
+
        fseeko tests: EBADF tests.
        * tests/test-fseeko4.sh: New file.
        * tests/test-fseeko4.c: New file.