gnulib.git
12 years agomkdir: Tweak for MSVC 9.
Bruno Haible [Fri, 23 Sep 2011 10:46:14 +0000 (12:46 +0200)]
mkdir: Tweak for MSVC 9.

* lib/sys_stat.in.h: Update comments.
* doc/posix-functions/mkdir.texi: Mention problem on MSVC 9.

12 years agoTests for module 'chdir'.
Bruno Haible [Fri, 23 Sep 2011 10:38:49 +0000 (12:38 +0200)]
Tests for module 'chdir'.

* modules/chdir-tests: New file.
* tests/test-chdir.c: New file.

12 years agoNew module 'chdir'.
Bruno Haible [Fri, 23 Sep 2011 10:32:41 +0000 (12:32 +0200)]
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.

12 years agormdir: Support for mingw, MSVC 9.
Bruno Haible [Fri, 23 Sep 2011 10:08:40 +0000 (12:08 +0200)]
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.

12 years agogetcwd: Tweak for MSVC 9.
Bruno Haible [Fri, 23 Sep 2011 10:05:16 +0000 (12:05 +0200)]
getcwd: Tweak for MSVC 9.

* lib/unistd.in.h: Update comments.
* doc/posix-functions/getcwd.texi: Mention problem on MSVC 9.

12 years agostrerror_r-posix: Avoid a link error on MSVC.
Bruno Haible [Thu, 22 Sep 2011 22:13:29 +0000 (00:13 +0200)]
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.

12 years agoselect: Avoid link errors on MSVC.
Bruno Haible [Thu, 22 Sep 2011 21:45:06 +0000 (23:45 +0200)]
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).

12 years agoselect: Avoid compilation error on MSVC.
Bruno Haible [Thu, 22 Sep 2011 21:33:51 +0000 (23:33 +0200)]
select: Avoid compilation error on MSVC.

* lib/select.c: Don't include <stdbool.h>.

12 years agoConsolidate all uses of PATH_MAX in *.m4 files.
Bruno Haible [Thu, 22 Sep 2011 12:17:57 +0000 (14:17 +0200)]
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.

12 years agoftruncate: Un-deprecate, concentrate on Win32 support.
Bruno Haible [Thu, 22 Sep 2011 12:16:31 +0000 (14:16 +0200)]
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.

12 years agoAdd dependencies to new dirent related modules.
Bruno Haible [Wed, 21 Sep 2011 23:48:01 +0000 (01:48 +0200)]
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.

12 years agoopendir: Avoid compilation error on mingw.
Bruno Haible [Wed, 21 Sep 2011 21:19:44 +0000 (23:19 +0200)]
opendir: Avoid compilation error on mingw.

* lib/opendir.c: Include <stddef.h> always. Include <unistd.h> as well.
* modules/opendir (Depends-on): Add unistd.

12 years agoftruncate tests: Avoid a test failure on mingw.
Bruno Haible [Wed, 21 Sep 2011 20:22:46 +0000 (22:22 +0200)]
ftruncate tests: Avoid a test failure on mingw.

* tests/test-ftruncate.c (main): Allow a failure with EACCES.

12 years agoselect tests: Avoid test failures on OSF/1 5.1 and mingw.
Bruno Haible [Wed, 21 Sep 2011 19:28:38 +0000 (21:28 +0200)]
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.

12 years agoNew module 'fdopen'.
Bruno Haible [Wed, 21 Sep 2011 19:16:45 +0000 (21:16 +0200)]
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.

12 years agounlockpt tests: Avoid test failure on NetBSD 5.1.
Bruno Haible [Wed, 21 Sep 2011 10:43:20 +0000 (12:43 +0200)]
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.

12 years agogetlogin, getlogin_r tests: Avoid test failure on Linux/SPARC.
Bruno Haible [Wed, 21 Sep 2011 10:21:47 +0000 (12:21 +0200)]
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.

12 years agotime tests: Don't require pid_t.
Bruno Haible [Tue, 20 Sep 2011 23:10:05 +0000 (01:10 +0200)]
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.

12 years agotime tests: Don't require pid_t.
Bruno Haible [Tue, 20 Sep 2011 23:03:23 +0000 (01:03 +0200)]
time tests: Don't require pid_t.

* tests/test-time.c: Comment out the check for pid_t.

12 years agofsync tests: Avoid a test failure on mingw.
Bruno Haible [Tue, 20 Sep 2011 22:46:15 +0000 (00:46 +0200)]
fsync tests: Avoid a test failure on mingw.

* tests/test-fsync.c (main): Allow a failure with EIO.

12 years agoeuidaccess: Update comments.
Bruno Haible [Tue, 20 Sep 2011 22:33:15 +0000 (00:33 +0200)]
euidaccess: Update comments.

* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Update comments.

12 years agoEnsure EBADF returns for socket functions on mingw.
Bruno Haible [Tue, 20 Sep 2011 22:20:59 +0000 (00:20 +0200)]
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.

12 years agoselect tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:59:33 +0000 (23:59 +0200)]
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.

12 years agoTests for module 'posix_spawn_file_actions_addopen.
Bruno Haible [Tue, 20 Sep 2011 21:21:26 +0000 (23:21 +0200)]
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.

12 years agoTests for module 'posix_spawn_file_actions_adddup2'.
Bruno Haible [Tue, 20 Sep 2011 21:20:26 +0000 (23:20 +0200)]
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.

12 years agoTests for module 'posix_spawn_file_actions_addclose'.
Bruno Haible [Tue, 20 Sep 2011 21:19:22 +0000 (23:19 +0200)]
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.

12 years agoTests for module 'unlockpt'.
Bruno Haible [Tue, 20 Sep 2011 21:17:56 +0000 (23:17 +0200)]
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.

12 years agoTests for module 'grantpt'.
Bruno Haible [Tue, 20 Sep 2011 21:16:35 +0000 (23:16 +0200)]
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.

12 years agofreopen tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:13:46 +0000 (23:13 +0200)]
freopen tests: EBADF tests.

* tests/test-freopen.c: Include errno.h, unistd.h.
(main): Add tests for EBADF, commented out for the moment.

12 years agofclose tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:12:01 +0000 (23:12 +0200)]
fclose tests: EBADF tests.

* tests/test-fclose.c (main): Add tests for EBADF.

12 years agofflush tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:10:44 +0000 (23:10 +0200)]
fflush tests: EBADF tests.

* tests/test-fflush.c: Include errno.h, macros.h.
(main): Add tests for EBADF.

12 years agoftello tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:09:06 +0000 (23:09 +0200)]
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.

12 years agofseeko tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:07:31 +0000 (23:07 +0200)]
fseeko tests: EBADF tests.

* tests/test-fseeko4.sh: New file.
* tests/test-fseeko4.c: New file.
* modules/fseeko-tests (Files): Add them.
(Makefile.am): Arrange to compile test-fseeko4 and run test-fseeko4.sh.

12 years agoTests for function fputc().
Bruno Haible [Tue, 20 Sep 2011 21:04:11 +0000 (23:04 +0200)]
Tests for function fputc().

* modules/fputc-tests: New file.
* tests/test-fputc.c: New file.
* modules/stdio-tests (Depends-on): Add fputc-tests.

12 years agoTests for function fgetc().
Bruno Haible [Tue, 20 Sep 2011 21:02:57 +0000 (23:02 +0200)]
Tests for function fgetc().

* modules/fgetc-tests: New file.
* tests/test-fgetc.c: New file.
* modules/stdio-tests (Depends-on): Add fgetc-tests.

12 years agoTests for function fdopen().
Bruno Haible [Tue, 20 Sep 2011 21:01:20 +0000 (23:01 +0200)]
Tests for function fdopen().

* modules/fdopen-tests: New file.
* tests/test-fdopen.c: New file.
* modules/stdio-tests (Depends-on): Add fdopen-tests.

12 years agoTests for module 'vdprintf'.
Bruno Haible [Tue, 20 Sep 2011 20:58:04 +0000 (22:58 +0200)]
Tests for module 'vdprintf'.

* modules/vdprintf-tests: New file.
* tests/test-vdprintf.c: New file.

12 years agoTests for module 'dprintf'.
Bruno Haible [Tue, 20 Sep 2011 20:57:24 +0000 (22:57 +0200)]
Tests for module 'dprintf'.

* modules/dprintf-tests: New file.
* tests/test-dprintf.c: New file.

12 years agoTests for module 'ioctl'.
Bruno Haible [Tue, 20 Sep 2011 20:52:59 +0000 (22:52 +0200)]
Tests for module 'ioctl'.

* modules/ioctl-tests: New file.
* tests/test-ioctl.c: New file.

12 years agofcntl tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:51:30 +0000 (22:51 +0200)]
fcntl tests: EBADF tests.

* tests/test-fcntl.c (main): Add more tests for EBADF.

12 years agoutimensat tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:49:52 +0000 (22:49 +0200)]
utimensat tests: EBADF tests.

* tests/test-utimensat.c (main): Add tests for EBADF.

12 years agorenameat tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:48:42 +0000 (22:48 +0200)]
renameat tests: EBADF tests.

* tests/test-renameat.c (main): Add tests for EBADF.

12 years agomkfifoat tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:47:20 +0000 (22:47 +0200)]
mkfifoat tests: EBADF tests.

* tests/test-mkfifoat.c (main): Add tests for EBADF.

12 years agoreadlinkat tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:45:40 +0000 (22:45 +0200)]
readlinkat tests: EBADF tests.

* tests/test-readlinkat.c (main): Add tests for EBADF.

12 years agosymlinkat tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:44:41 +0000 (22:44 +0200)]
symlinkat tests: EBADF tests.

* tests/test-symlinkat.c (main): Add tests for EBADF.

12 years agolinkat tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:43:43 +0000 (22:43 +0200)]
linkat tests: EBADF tests.

* tests/test-linkat.c (main): Add tests for EBADF.

12 years agoTests for module 'faccessat'.
Bruno Haible [Tue, 20 Sep 2011 20:41:40 +0000 (22:41 +0200)]
Tests for module 'faccessat'.

* modules/faccessat-tests: New file.
* tests/test-faccessat.c: New file.

12 years agofdopendir tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:39:51 +0000 (22:39 +0200)]
fdopendir tests: EBADF tests.

* tests/test-fdopendir.c (main): Add more tests for EBADF.

12 years agoopenat tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:36:37 +0000 (22:36 +0200)]
openat tests: EBADF tests.

* tests/test-fchownat.c (main): Add tests for EBADF.
* tests/test-fstatat.c (main): Likewise.
* tests/test-mkdirat.c (main): Likewise.
* tests/test-openat.c (main): Likewise.
* tests/test-unlinkat.c (main): Likewise.
* tests/test-fchmodat.c: New file.
* modules/openat-tests (Files): Add tests/test-fchmodat.c.
(Makefile.am): Also run 'test-fchmodat'.

12 years agoutimens, futimens, fdutimensat tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:29:28 +0000 (22:29 +0200)]
utimens, futimens, fdutimensat tests: EBADF tests.

* tests/test-futimens.h (test_futimens): Add more tests for EBADF.

12 years agoTests for function fstat().
Bruno Haible [Tue, 20 Sep 2011 20:26:34 +0000 (22:26 +0200)]
Tests for function fstat().

* modules/fstat-tests: New file.
* tests/test-fstat.c: New file.
* modules/sys_stat-tests (Depends-on): Add fstat-tests.

12 years agotest-ttyname_r tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:22:15 +0000 (22:22 +0200)]
test-ttyname_r tests: EBADF tests.

* tests/test-ttyname_r.c (main): Add tests for EBADF.

12 years agoTests for module 'isatty'.
Bruno Haible [Tue, 20 Sep 2011 20:19:24 +0000 (22:19 +0200)]
Tests for module 'isatty'.

* modules/isatty-tests: New file.
* tests/test-isatty.c: New file.

12 years agoTests for module 'write'.
Bruno Haible [Tue, 20 Sep 2011 20:17:21 +0000 (22:17 +0200)]
Tests for module 'write'.

* modules/write-tests: New file.
* tests/test-write.c: New file.

12 years agoTests for module 'read'.
Bruno Haible [Tue, 20 Sep 2011 20:16:23 +0000 (22:16 +0200)]
Tests for module 'read'.

* modules/read-tests: New file.
* tests/test-read.c: New file.

12 years agopwrite tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:14:38 +0000 (22:14 +0200)]
pwrite tests: EBADF tests.

* tests/test-pwrite.c (main): Add tests for EBADF.

12 years agopread tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:12:22 +0000 (22:12 +0200)]
pread tests: EBADF tests.

* tests/test-pread.c (main): Add tests for EBADF.

12 years agolseek tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:09:55 +0000 (22:09 +0200)]
lseek tests: EBADF tests.

* tests/test-lseek.c (main): Add more tests for EBADF.

12 years agoTests for module 'ftruncate'.
Bruno Haible [Tue, 20 Sep 2011 20:07:48 +0000 (22:07 +0200)]
Tests for module 'ftruncate'.

* modules/ftruncate-tests: New file.
* tests/test-ftruncate.sh: New file.
* tests/test-ftruncate.c: New file.

12 years agofsync tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:05:29 +0000 (22:05 +0200)]
fsync tests: EBADF tests.

* tests/test-fsync.c (main): Add more tests for EBADF.

12 years agofdatasync tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 20:03:35 +0000 (22:03 +0200)]
fdatasync tests: EBADF tests.

* tests/test-fdatasync.c (main): Add more tests for EBADF.

12 years agoTests for module 'fchown'.
Bruno Haible [Tue, 20 Sep 2011 20:01:43 +0000 (22:01 +0200)]
Tests for module 'fchown'.

* modules/fchown-tests: New file.
* tests/test-fchown.c: New file.

12 years agoTests for module 'fchmod'.
Bruno Haible [Tue, 20 Sep 2011 20:00:29 +0000 (22:00 +0200)]
Tests for module 'fchmod'.

* modules/fchmod-tests: New file.
* tests/test-fchmod.c: New file.

12 years agofchdir tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 19:58:23 +0000 (21:58 +0200)]
fchdir tests: EBADF tests.

* tests/test-fchdir.c (main): Add more tests for EBADF.

12 years agodup2 tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 19:56:23 +0000 (21:56 +0200)]
dup2 tests: EBADF tests.

* tests/test-dup2.c (main): Add more tests for EBADF.

12 years agoTests for module 'dup'.
Bruno Haible [Tue, 20 Sep 2011 19:52:55 +0000 (21:52 +0200)]
Tests for module 'dup'.

* modules/dup-tests: New file.
* tests/test-dup.c: New file.

12 years agoTests for module 'close'.
Bruno Haible [Tue, 20 Sep 2011 19:51:45 +0000 (21:51 +0200)]
Tests for module 'close'.

* modules/close-tests: New file.
* tests/test-close.c: New file.

12 years agoTests for module 'shutdown'.
Bruno Haible [Tue, 20 Sep 2011 19:38:04 +0000 (21:38 +0200)]
Tests for module 'shutdown'.

* modules/shutdown-tests: New file.
* tests/test-shutdown.c: New file.

12 years agoTests for module 'setsockopt'.
Bruno Haible [Tue, 20 Sep 2011 19:36:56 +0000 (21:36 +0200)]
Tests for module 'setsockopt'.

* modules/setsockopt-tests: New file.
* tests/test-setsockopt.c: New file.

12 years agoTests for module 'sendto'.
Bruno Haible [Tue, 20 Sep 2011 19:35:53 +0000 (21:35 +0200)]
Tests for module 'sendto'.

* modules/sendto-tests: New file.
* tests/test-sendto.c: New file.

12 years agoTests for module 'send'.
Bruno Haible [Tue, 20 Sep 2011 19:35:19 +0000 (21:35 +0200)]
Tests for module 'send'.

* modules/send-tests: New file.
* tests/test-send.c: New file.

12 years agoTests for module 'recvfrom'.
Bruno Haible [Tue, 20 Sep 2011 19:34:35 +0000 (21:34 +0200)]
Tests for module 'recvfrom'.

* modules/recvfrom-tests: New file.
* tests/test-recvfrom.c: New file.

12 years agoTests for module 'recv'.
Bruno Haible [Tue, 20 Sep 2011 19:33:55 +0000 (21:33 +0200)]
Tests for module 'recv'.

* modules/recv-tests: New file.
* tests/test-recv.c: New file.

12 years agoTests for module 'listen'.
Bruno Haible [Tue, 20 Sep 2011 19:32:43 +0000 (21:32 +0200)]
Tests for module 'listen'.

* modules/listen-tests: New file.
* tests/test-listen.c: New file.

12 years agoTests for module 'getsockopt'.
Bruno Haible [Tue, 20 Sep 2011 19:31:43 +0000 (21:31 +0200)]
Tests for module 'getsockopt'.

* modules/getsockopt-tests: New file.
* tests/test-getsockopt.c: New file.

12 years agoTests for module 'getsockname'.
Bruno Haible [Tue, 20 Sep 2011 19:30:21 +0000 (21:30 +0200)]
Tests for module 'getsockname'.

* modules/getsockname-tests: New file.
* tests/test-getsockname.c: New file.

12 years agoTests for module 'getpeername'.
Bruno Haible [Tue, 20 Sep 2011 19:29:26 +0000 (21:29 +0200)]
Tests for module 'getpeername'.

* modules/getpeername-tests: New file.
* tests/test-getpeername.c: New file.

12 years agoTests for module 'connect'.
Bruno Haible [Tue, 20 Sep 2011 19:28:17 +0000 (21:28 +0200)]
Tests for module 'connect'.

* modules/connect-tests: New file.
* tests/test-connect.c: New file.

12 years agoTests for module 'bind'.
Bruno Haible [Tue, 20 Sep 2011 19:25:50 +0000 (21:25 +0200)]
Tests for module 'bind'.

* modules/bind-tests: New file.
* tests/test-bind.c: New file.

12 years agoaccept4 tests: Fix for native Windows.
Bruno Haible [Tue, 20 Sep 2011 19:24:02 +0000 (21:24 +0200)]
accept4 tests: Fix for native Windows.

* tests/test-accept4.c: Include sockets.h.
(main): Invoke gl_sockets_startup.
* modules/accept4-tests (Depends-on): Add sockets.

12 years agoaccept tests: Fix for native Windows.
Bruno Haible [Tue, 20 Sep 2011 19:22:22 +0000 (21:22 +0200)]
accept tests: Fix for native Windows.

* tests/test-accept.c: Include sockets.h.
(main): Invoke gl_sockets_startup.
* modules/accept-tests (Depends-on): Add sockets.

12 years agomsvc-inval: Require a semicolon after DONE_MSVC_INVAL.
Bruno Haible [Tue, 20 Sep 2011 01:16:18 +0000 (03:16 +0200)]
msvc-inval: Require a semicolon after DONE_MSVC_INVAL.

* lib/msvc-inval.h (TRY_MSVC_INVAL, DONE_MSVC_INVAL): Wrap in a
do...while(0).
* lib/dup2.c (rpl_dup2): Add a semicolon after DONE_MSVC_INVAL.
Suggested by Paul Eggert.

12 years agosched: Ensure pid_t is defined.
Bruno Haible [Mon, 19 Sep 2011 21:48:58 +0000 (23:48 +0200)]
sched: Ensure pid_t is defined.

* m4/sched_h.m4 (gl_SCHED_H): Arrange to override <sched.h> if it does
not define pid_t.
* lib/sched.in.h: Include <sys/types.h>.
* doc/posix-headers/sched.texi: Mention the pid_t problem.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.

12 years agomsvc-inval: Ensure the entire expansion is a single statement.
Bruno Haible [Mon, 19 Sep 2011 21:29:44 +0000 (23:29 +0200)]
msvc-inval: Ensure the entire expansion is a single statement.

* lib/msvc-inval.h (TRY_MSVC_INVAL, DONE_MSVC_INVAL): Add an extra pair
of braces.

12 years agotests: use printf, not echo in init.sh's warn_ function
Jim Meyering [Mon, 19 Sep 2011 17:27:53 +0000 (19:27 +0200)]
tests: use printf, not echo in init.sh's warn_ function

* tests/init.sh (warn_): Use printf, not echo.  The latter would
misbehave when given strings containing a backslash or starting
with e.g., -n.  James Youngman suggested setting IFS.

12 years agofutimens: enhance test
Eric Blake [Mon, 19 Sep 2011 17:10:16 +0000 (11:10 -0600)]
futimens: enhance test

Test that previous futimens change doesn't regress.

* tests/test-futimens.h (test_futimens): Also check for EBADF on
closed non-negative fd.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agodate: accept 'hence' as opposite of 'ago'
Eric Blake [Fri, 16 Sep 2011 20:52:54 +0000 (14:52 -0600)]
date: accept 'hence' as opposite of 'ago'

* lib/parse-datetime.y (relative_time_table): Add 'hence'.
* tests/test-parse-datetime.c (main): Enhance test.
Suggested by Jesse Wilson.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agogetcwd: don't fail in a deep directory on a system without openat
Jim Meyering [Mon, 19 Sep 2011 07:48:35 +0000 (09:48 +0200)]
getcwd: don't fail in a deep directory on a system without openat

Before this change, getcwd would fail when called from a directory
of depth PATH_MAX / 3 or greater.  That was due to the fact that
the non-openat implementation used "..", "../..", "../../..", etc.
to access ancestor directories.  With too many, that string would
be longer than PATH_MAX.
* lib/getcwd.c (HAVE_OPENAT_SUPPORT): Define also when we are
using gnulib's openat replacement.
* m4/openat.m4: Set GNULIB_OPENAT, so getcwd.c knows when
we're using the replacement function.

12 years agomaint.mk: avoid warnings from perl about missing files
Martin von Gagern [Wed, 14 Sep 2011 13:33:16 +0000 (15:33 +0200)]
maint.mk: avoid warnings from perl about missing files

* top/maint.mk (def_sym_regex): Ignore files listed in
$(gl_other_headers_) that do not exist, say because a project
does not use a corresponding module.

12 years ago* lib/stat.c: Move comment.
Paul Eggert [Mon, 19 Sep 2011 14:34:58 +0000 (07:34 -0700)]
* lib/stat.c: Move comment.

12 years agostat: use pathmax.h only if needed
Paul Eggert [Mon, 19 Sep 2011 04:46:34 +0000 (21:46 -0700)]
stat: use pathmax.h only if needed

* lib/stat.c: Include pathmax.h only if REPLACE_FUNC_STAT_DIR.
This is better for Emacs, which does not have a mingw port and
therefore can avoid the pathmax module.

12 years agoutimens: remove dependency on dup2
Paul Eggert [Mon, 19 Sep 2011 03:57:48 +0000 (20:57 -0700)]
utimens: remove dependency on dup2

* lib/utimens.c (fdutimens): Don't invoke dup2; it's not needed
to work around the Linux kernel bug.
* modules/utimens (Depends-on): Remove dup2.

12 years agoinet_ntop, inet_pton: Look for it also in libresolv.
Bruno Haible [Mon, 19 Sep 2011 01:44:56 +0000 (03:44 +0200)]
inet_ntop, inet_pton: Look for it also in libresolv.

* m4/inet_ntop.m4 (gl_FUNC_INET_NTOP): If the function was not found in
libnsl, search for it in libresolv.
* m4/inet_pton.m4 (gl_FUNC_INET_PTON): Likewise.
Needed on Solaris 7.

12 years agoaccept, accept4 tests: Avoid link error on Solaris.
Bruno Haible [Mon, 19 Sep 2011 01:10:16 +0000 (03:10 +0200)]
accept, accept4 tests: Avoid link error on Solaris.

* modules/accept-tests (Makefile.am): Link test-accept against
$(LIBSOCKET).
* modules/accept4-tests (Makefile.am): Link test-accept4 against
$(LIBSOCKET).

12 years agoaccept4: Avoid link error on Solaris.
Bruno Haible [Mon, 19 Sep 2011 01:07:25 +0000 (03:07 +0200)]
accept4: Avoid link error on Solaris.

* modules/accept4 (Link): New section.

12 years agosocket functions: Avoid link errors on Solaris.
Bruno Haible [Mon, 19 Sep 2011 00:13:59 +0000 (02:13 +0200)]
socket functions: Avoid link errors on Solaris.

* modules/accept (Depends-on): Add socketlib.
(Link): New section.
* modules/bind (Depends-on): Add socketlib.
(Link): New section.
* modules/connect (Depends-on): Add socketlib.
(Link): New section.
* modules/getpeername (Depends-on): Add socketlib.
(Link): New section.
* modules/getsockname (Depends-on): Add socketlib.
(Link): New section.
* modules/getsockopt (Depends-on): Add socketlib.
(Link): New section.
* modules/listen (Depends-on): Add socketlib.
(Link): New section.
* modules/recv (Depends-on): Add socketlib.
(Link): New section.
* modules/recvfrom (Depends-on): Add socketlib.
(Link): New section.
* modules/send (Depends-on): Add socketlib.
(Link): New section.
* modules/sendto (Depends-on): Add socketlib.
(Link): New section.
* modules/setsockopt (Depends-on): Add socketlib.
(Link): New section.
* modules/shutdown (Depends-on): Add socketlib.
(Link): New section.
* modules/socket (Depends-on): Add socketlib.
(Link): New section.

12 years agoptsname tests: Let the test fail rather than hang (e.g. on AIX 5.1).
Bruno Haible [Sun, 18 Sep 2011 23:02:09 +0000 (01:02 +0200)]
ptsname tests: Let the test fail rather than hang (e.g. on AIX 5.1).

* tests/test-ptsname.c (main): Terminate the test if it takes longer
than 5 seconds.
* modules/ptsname-tests (configure.ac): Test for alarm.

12 years agoposix_spawn_file_actions_add*: Fix module dependencies.
Bruno Haible [Sun, 18 Sep 2011 22:44:04 +0000 (00:44 +0200)]
posix_spawn_file_actions_add*: Fix module dependencies.

* modules/posix_spawn_file_actions_addclose (Dependencies): Add
posix_spawn_file_actions_init.
* modules/posix_spawn_file_actions_adddup2 (Dependencies): Likewise.
* modules/posix_spawn_file_actions_addopen (Dependencies): Likewise.

12 years agorename, renameat tests: Avoid test failures on FreeBSD 6.4.
Bruno Haible [Sun, 18 Sep 2011 22:35:39 +0000 (00:35 +0200)]
rename, renameat tests: Avoid test failures on FreeBSD 6.4.

* tests/test-rename.h (test_rename): Allow error code EEXIST.
* tests/test-renameat.c (main): Likewise.

12 years agoTests for module 'accept4'.
Bruno Haible [Sun, 18 Sep 2011 09:17:24 +0000 (11:17 +0200)]
Tests for module 'accept4'.

* modules/accept4-tests: New file.
* tests/test-accept4.c: New file.