tests


Log

Author Commit Date CI Message
Paul Eggert 98f5f49c 2011-07-12T01:16:45 modules/_Exit-tests: test _Noreturn too * tests/test-_Exit.c (MTA, Charlie): New functions, taken from the old tests/test-stdnoreturn.c. This tests the _Noreturn keyword a bit. (main): Use them.
Paul Eggert 4b69a607 2011-07-12T01:16:08 stdnoreturn, stdnoreturn-tests: remove modules They're not needed here and a bit premature for use elsewhere. See <http://lists.gnu.org/archive/html/bug-gnulib/2011-07/msg00209.html>. * m4/stdnoreturn.m4, modules/stdnoreturn, modules/stdnoreturn-tests: * tests/test-stdnoreturn.c: Remove files. * MODULES.html.sh (_Noreturn <stdnoreturn.h>): Remove section. * lib/openat.h, lib/sigpipe-die.h, lib/xalloc.h, lib/xmemdup0.h: * lib/xstrtol.h: Use _Noreturn rather than including <stdnoreturn.h> and using noreturn. * modules/openat, modules/sigpipe-die, modules/xalloc: * modules/xmemdup0, modules/xstrtol: Remove dependency on stdnoreturn.
Paul Eggert 5e065fab 2011-07-12T01:14:47 _Noreturn-tests: remove module * modules/_Noreturn-tests: Remove. * modules/stdnoreturn-tests (Files): Remove tests/test-_Noreturn.c. * tests/test-_Noreturn.c: Remove. * tests/test-stdnoreturn.c: Merge from the old tests/test-_Noreturn.c, testing both noreturn and _Noreturn.
Paul Eggert 6267b9ec 2011-07-12T01:05:34 exclude_tests: use _Noreturn
Paul Eggert 48fa9343 2011-07-12T01:03:40 argmatch-tests: use _Noreturn * tests/test-argmatch.c (_GL_ATTRIBUTE_NORETURN): Remove. (ARGMATCH_DIE_DECL): Use _Noreturn instead.
Paul Eggert 1287b65e 2011-07-12T01:01:45 stdnoreturn-tests: new module * modules/stdnoreturn-tests, tests/test-stdnoreturn.c: New files.
Paul Eggert 43c4ede2 2011-07-12T00:58:32 _Noreturn-tests: new module * modules/_Noreturn-tests, tests/test-_Noreturn.c: New files.
Eric Blake a918da4d 2011-07-11T17:05:34 ffs: new module Libvirt wants to use ffs() to avoid dragging in -lm for log2(). * modules/ffs: New file. * m4/ffs.m4: Likewise. * lib/ffs.c: Likewise. * m4/strings_h.m4 (gl_HEADER_STRINGS_H_DEFAULTS): Add default. * modules/strings (Makefile.am): Substitute witness. (Depends-on): Add c++defs. * lib/strings.in.h (ffs): Declare. * modules/ffs-tests: New test file. * tests/test-ffs.c: Test new module. * MODULES.html.sh (Integer arithmetic functions): Mention it. * doc/posix-functions/ffs.texi (ffs): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible 9a4ef223 2011-07-09T02:00:59 pthread_sigmask tests: Avoid a compiler warning. * tests/test-pthread_sigmask1.c (main): Complain if system() returns non-zero.
Bruno Haible e82dcbb7 2011-07-09T01:59:31 sigprocmask tests: A better way to avoid a compiler warning. * tests/test-sigprocmask.c: Don't include "ignore-value.h". (main): Complain if system() returns non-zero. * modules/sigprocmask-tests (Depends-on): Remove ignore-value.
Eric Blake b80db060 2011-07-08T15:55:40 test-sigprocmask: avoid compiler warning * modules/sigprocmask-tests (Depends-on): Add ignore-value. * tests/test-sigprocmask.c (main): Use it to silence warning. Reported by Jim Meyering. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 71af89e8 2011-07-08T15:57:31 test-snprintf: avoid compiler warning * tests/test-snprintf.c (main): Avoid shadowed declaration. * tests/test-vsnprintf.c (main): Likewise. Reported by Jim Meyering. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible b11005d1 2011-07-08T19:12:14 Tests for module 'pthread_sigmask'. * modules/pthread_sigmask-tests: New file. * tests/test-pthread_sigmask1.c: New file, based on tests/test-sigprocmask.c. * tests/test-pthread_sigmask2.c: New file.
Jim Meyering a406aaff 2011-07-08T23:17:36 test-getopt.h: avoid warning about an unused variable * tests/test-getopt.h (test_getopt): Remove unused variable, "c".
Bruno Haible 23a17dd5 2011-07-08T13:28:54 Tests for module 'thread'. * modules/thread-tests: New file. * tests/test-thread_self.c: New file. * tests/test-thread_create.cc: New file.
Bruno Haible 767a3af6 2011-07-08T04:13:53 signal-c++-tests: Check declaration of pthread_sigmask. * tests/test-signal-c++.cc: Check declaration of pthread_sigmask. * modules/signal-c++-tests (Makefile.am): Link test-signal-c++ against $(LIB_PTHREAD_SIGMASK).
Bruno Haible 56005a21 2011-07-07T19:52:19 Tests for module 'sigprocmask'. * modules/sigprocmask-tests: New file. * tests/test-sigprocmask.c: New file.
Bruno Haible 39414ac9 2011-07-07T19:50:35 float tests: Tweak. * tests/test-float.c (main): Tweak skip message.
Eric Blake 366d08c0 2011-07-07T10:24:20 getopt-gnu: avoid crash in glibc getopt Use of "W;" in an option string may be rare, but we might as well avoid crashing on it. * m4/getopt.m4 (gl_GETOPT_CHECK_HEADRS): Detect the problem. * tests/test-getopt.h (test_getopt): Enhance test. * tests/test-getopt_long.h (test_getopt_long): Likewise. * doc/posix-functions/getopt.texi (getopt): Document it. * doc/glibc-functions/getopt_long.texi (getopt_long): Likewise. * doc/glibc-functions/getopt_long_only.texi (getopt_long_only): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Paul Eggert 623de735 2011-07-05T14:46:08 test-pselect: new module * modules/pselect-tests, tests/test-pselect.c: New files. * tests/test-select.c, tests/test-sys_select-c++.cc: If TEST_PSELECT is defined, test pselect instead of testing select.
Paul Eggert 498a60f8 2011-07-05T14:42:11 * tests/test-sys_select.c (sigset_t): Test for it, too. Suggested by Bruno Haible.
Eric Blake c3153d2c 2011-07-01T08:20:06 snprintf: guarantee %1$d, for libintl Newer mingw (but not yet mingw64) provides two flavors of snprintf: _snprintf defers straight to msvcrt, which has broken return value and does not understand %llu or %zu; and snprintf, which fixes these two bugs but does not understand %1$s. Libintl specifically favors _snprintf, with broken return value, even when compiled on mingw with a fixed snprintf, because the only behavior which it wants to fix is %1$s handling. But this means that the replacement libintl_snprintf has a broken return. If one uses the 'snprintf-posix' module, then the gnulib replacement kicks in, and does everything that libintl needs, so on mingw, <libintl.h> specifically avoids overriding snprintf if it detected that gnulib replaced snprintf. However, if one only uses the 'snprintf' module and also uses libintl, this means there are two problems: 1. The gnulib 'snprintf' module does not replace the mingw snprintf function, because it has proper return values, while the libintl.h header knows that %1$d is broken so snprintf must be replaced, with the end result that the application gets the libintl replacement snprintf with broken return values in spite of the gnulib module. 2. Conversely, if the application did '#define snprintf snprintf', that would be enough to make libintl avoid installing its own replacement because libintl would see the define as a sign that gnulib is happy with snprintf. However, if gnulib didn't enforce %1$s, users can end up with translated strings that break when passed to the native snprintf. Happily, the gnulib snprintf replacement already guarantees %1$s without needing any further preprocessor macros defined, and without dragging in the LGPLv3+ bulk of snprintf-posix, so the problem boils down to guaranteeing that gnulib will replace snprintf if it lacks %1$s support. Basically, gnulib must replace snprintf under all the same conditions as libintl, as well as any other conditions of its own, if the libintl trick of deferring to gnulib is to work correctly. * m4/snprintf.m4 (gl_FUNC_SNPRINTF): Require %1$d support. * m4/vsnprintf.m4 (gl_FUNC_VSNPRINTF): Likewise. * doc/posix-functions/snprintf.texi (snprintf): Update. * doc/posix-functions/vsnprintf.texi (vsnprintf): Likewise. * tests/test-snprintf.c (main): Enhance test. * tests/test-vsnprintf.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Jim Meyering 00a19598 2011-07-04T12:31:05 maint: indent with spaces, not TABs, and add a rule to check this * tests/test-userspec.c: Indent with spaces, not TABs. * tests/test-argp.c: Likewise. * tests/test-c-stack2.sh: Likewise. * tests/test-parse-duration.sh: Likewise * m4/strtod.m4: Likewise. * m4/alloca.m4: Likewise. * m4/pselect.m4: Likewise. * Makefile (sc_prohibit_leading_TABs): Prohibit leading TABs.
Eric Blake df1c2344 2011-06-22T12:15:02 link: work around IRIX bug On IRIX 6.5, link(file, "dangling") creates the target of dangling as a link to file, rather than failing with EEXIST. * m4/link.m4 (gl_FUNC_LINK): Expose the bug. * lib/link.c (rpl_link): Work around it. * tests/test-link.h (test_link): Enhance test. * doc/posix-functions/link.texi (link): Document the bug. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake d80aff0a 2011-06-20T15:12:10 test-stat: don't allocate PATH_MAX bytes POSIX allows systems (like Hurd) that don't define PATH_MAX, or which define it larger than a reasonable stack allocation should be. The test originally used stack allocation to avoid portability problems with getcwd, but the getcwd-lgpl module solves those. * tests/test-stat.h (test_stat_func): Don't stack-allocate a PATH_MAX-sized buffer. * modules/openat-tests (Depends-on): Add getcwd-lgpl, drop pathmax. * modules/stat-tests (Depends-on): Likewise. * tests/test-fstatat.c (includes): Drop pathmax.h. * tests/test-stat.c (includes): Likewise. Reported by Bruno Haible. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible 47adaa09 2011-06-20T12:27:26 Tests for module 'float'. * modules/float-tests: New file. * tests/test-float.c: New file.
Bruno Haible bcb4e47f 2011-06-19T20:41:46 linkat test: Avoid test failure on AIX 7.1. * tests/test-linkat.c (main): Allow EINVAL as alternate error value. * tests/test-link.h (test_link): Likewise.
Bruno Haible 55ebb02f 2011-06-19T16:36:39 pread test: Avoid test failure on OpenBSD 4.9. * tests/test-pread.c (main): Allow EFBIG instead of EINBAL.
Bruno Haible e250cdd4 2011-06-19T03:13:17 fsync test: Avoid test failure on MacOS X and AIX. * tests/test-fsync.c (fsync): Allow ENOTSUP and EBADF instead of EINVAL.
Bruno Haible d9a273b2 2011-06-18T23:06:53 openat, fdopendir tests: Fix link errors. * modules/openat-tests (Depends-on): Add progname. * modules/fdopendir-tests (Depends-on): Likewise. * tests/test-fchownat.c: Include progname.h. (main): Call set_program_name. * tests/test-fstatat.c: Include progname.h. (main): Call set_program_name. * tests/test-mkdirat.c: Include progname.h. (main): Call set_program_name. * tests/test-openat.c: Include progname.h. (main): Call set_program_name. * tests/test-unlinkat.c: Include progname.h. (main): Call set_program_name. * tests/test-fdopendir.c: Include progname.h. (main): Call set_program_name.
Bruno Haible 1e33f8d8 2011-06-18T22:22:23 getcwd tests: Avoid compilation error on HP-UX 11.31. * modules/getcwd-tests (Depends-on): Add pathmax. * tests/test-getcwd.c: Include pathmax.h.
Bruno Haible d5b824ef 2011-06-17T18:08:21 spawn-pipe tests: Fix link error. * tests/test-spawn-pipe-child.c: Undefine fprintf. Reported by Tom G. Christensen <tgc@jupiterrise.com>.
Bruno Haible 724a59bc 2011-06-17T13:44:41 spawn-pipe tests: Fix link error. * tests/test-spawn-pipe-child.c: Undefine fflush.
Paul Eggert 0e24c598 2011-06-15T11:15:37 verify: new macro verify_expr; verify_true deprecated * NEWS: Mention this. * doc/verify.texi (Compile-time Assertions): Document this. * lib/verify.h (verify_true): Deprecate. (verify_expr): New macro. * tests/test-verify.c (function): Test verify_expr.
Jim Meyering 4af5eabf 2011-06-14T15:33:23 init.sh: give more portable redirection-related advice in a comment * tests/init.sh (stderr_fileno_): Update the advice in comments. See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488 for lots of discussion. Stefano Lattarini suggested the solution of putting "9>&2" after the command. Reported by Bruno Haible.
Bruno Haible 227b08bb 2011-06-13T02:11:03 acl: Add support for HP-UX >= 11.11 JFS ACLs. * doc/acl-resources.txt: Add info about the ACL APIs on HP-UX. * m4/acl.m4 (gl_FUNC_ACL): Also test for HP-UX 11.11 API. * lib/acl-internal.h [HP-UX 11.11]: Include <aclv.h>. (acl, aclsort): New declarations. (aclv_nontrivial): New declaration. * lib/file-has-acl.c (aclv_nontrivial) [HP-UX 11.11]: New function. (file_has_acl): Read also the second kind of HP-UX ACLs. * lib/set-mode-acl.c (qset_acl) [HP-UX 11.11]: Try to set the second kind of HP-UX ACLs if the first kind fails. * lib/copy-acl.c (qcopy_acl) [HP-UX 11.11]: Read and set also the second kind of HP-UX ACLs. * tests/test-sameacls.c [HP-UX 11.11]: Include <aclv.h>. (main) [HP-UX 11.11]: Test also whether the second kind of HP-UX ACLs agree. * tests/test-file-has-acl.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. Handle hpuxjfs. * tests/test-set-mode-acl.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. Handle hpuxjfs. * tests/test-copy-acl.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. (func_test_same_acls): Use both lsacl and getacl. Handle hpuxjfs. * tests/test-copy-file.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. (func_test_same_acls): Use both lsacl and getacl. Handle hpuxjfs.
Bruno Haible 9cbf59b7 2011-06-13T01:17:20 acl: Complete the 2010-08-10 fix. * lib/file-has-acl.c (file_has_acl) [HP-UX]: Also test against ENOTSUP. * lib/set-mode-acl.c (qset_acl) [HP-UX]: Likewise. * lib/copy-acl.c (qcopy_acl) [HP-UX]: Test for the errno values explicitly. * tests/test-sameacls.c (main) [HP-UX]: Also test against ENOTSUP. Reported in <http://debbugs.gnu.org/db/60/6053.html>.
Bruno Haible 13bba66f 2011-06-12T14:46:34 spawn-pipe tests: Comments. * tests/test-spawn-pipe-child.c (main): Update comment. Reported by James Youngman <jay@gnu.org>.
Bruno Haible f462d861 2011-06-09T12:40:44 thread: Support pthreads-win32. * lib/glthread/thread.h (gl_thread_self): Define differently on pthreads-win32. (gl_null_thread): New declaration. (gl_thread_self_pointer): New macro. * lib/glthread/thread.c (gl_null_thread): New constant. * tests/test-lock.c: Use gl_thread_self_pointer instead of gl_thread_self. * tests/test-tls.c: Likewise. Suggested by Paul Eggert. Reported by Eric Blake.
Bruno Haible d0080d2f 2011-06-09T11:37:58 spawn-pipe tests: Avoid test failure on HP-UX 11. * tests/test-spawn-pipe-child.c (main) [HP-UX]: Don't assert that fd 2 is closed.
Bruno Haible 97766809 2011-06-09T11:35:25 acl tests: Fix compilation error on HP-UX 11. * tests/test-sameacls.c: Include <sys/acl.h> also on HP-UX.
Bruno Haible 36397160 2011-06-09T11:21:23 rmdir: Avoid test failure on HP-UX 10.20. * tests/test-rmdir.h (test_rmdir_func): Accept ENOTEMPTY error, like EEXIST.
Eric Blake 79d4e75d 2011-06-07T20:49:04 strerror_r-posix: fix on MacOS MacOS X 10.5 strerror(0) is "Unknown error: 0", which is not distinguished from "Unknown error: -1" for out-of-range. Worse, strerror_r(0,,) is "Undefined error: 0", although strerror_r for all other out-of-range values matches strerror. * m4/strerror.m4 (gl_FUNC_STRERROR): Flush out MacOS bug. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R_WORKS): Likewise, and fix logic bug. * lib/strerror_r.c (strerror_r): Fix the bug. * lib/strerror.c (strerror): Likewise. * doc/posix-functions/strerror_r.texi (strerror_r): Document the problem. * doc/posix-functions/strerror.texi (strerror): Likewise. * doc/posix-functions/perror.texi (perror): Likewise. * tests/test-strerror.c (main): Enhance test. * tests/test-strerror_r.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake fd33cbeb 2011-06-07T15:41:20 test-perror: relax test to ignore cygwin bug glibc was not the only platform where fprintf(fopen(,"r")) fails to detect errors; cygwin 1.7.9 is another culprit (although it will be fixed for 1.7.10), and I suspect that several other platforms were failing perror2 for the same reason. At this point, there are so many functions affected, and the way to avoid the bug is easy enough (don't pass bogus streams to output-producing functions), that I'm not worried about fixing things other than to document them. * tests/test-perror2.c (main): Relax test on requiring detection of stream errors, and use unbuffered stream. * doc/posix-functions/dprintf.texi (dprintf): Document bug. * doc/posix-functions/fprintf.texi (fprintf): Likewise. * doc/posix-functions/fputc.texi (fputc): Likewise. * doc/posix-functions/fputs.texi (fputs): Likewise. * doc/posix-functions/fputws.texi (fputws): Likewise. * doc/posix-functions/fwprintf.texi (fwprintf): Likewise. * doc/posix-functions/fwrite.texi (fwrite): Likewise. * doc/posix-functions/getopt.texi (getopt): Likewise. * doc/posix-functions/perror.texi (perror): Likewise. * doc/posix-functions/printf.texi (printf): Likewise. * doc/posix-functions/psiginfo.texi (psiginfo): Likewise. * doc/posix-functions/psignal.texi (psignal): Likewise. * doc/posix-functions/putc.texi (putc): Likewise. * doc/posix-functions/putc_unlocked.texi (putc_unlocked): Likewise. * doc/posix-functions/putchar.texi (putchar): Likewise. * doc/posix-functions/putchar_unlocked.texi (putchar_unlocked): Likewise. * doc/posix-functions/puts.texi (puts): Likewise. * doc/posix-functions/putwc.texi (putwc): Likewise. * doc/posix-functions/putwchar.texi (putwchar): Likewise. * doc/posix-functions/vdprintf.texi (vdprintf): Likewise. * doc/posix-functions/vfprintf.texi (vfprintf): Likewise. * doc/posix-functions/vfwprintf.texi (vfwprintf): Likewise. * doc/posix-functions/vprintf.texi (vprintf): Likewise. * doc/posix-functions/vwprintf.texi (vwprintf): Likewise. * doc/posix-functions/wordexp.texi (wordexp): Likewise. * doc/posix-functions/wprintf.texi (wprintf): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Stefano Lattarini fba32455 2011-06-07T13:55:57 tests: fix usage message in 'mktempd_' * tests/init.sh (mktempd_): In the usage message, use literal 'mktempd_', not '$ME' (which is even undefined), as the name of the subroutine.
Stefano Lattarini b0579989 2011-06-07T13:27:00 tests init: new function 'fatal_', for hard errors Before this patch, the only way offered by tests/init.sh to properly signal a hard error was the `framework_failure_' function. But the error message issued by that function, as its name would suggest, refers to a set-up failure in the testsuite, while hard errors can obviously also be due to other reasons. The best way to fix this inconsistency is to introduce a new function with a more general error message. * tests/init.sh (fatal_): New function.
Bruno Haible e5ff5946 2011-06-06T11:42:17 spawn-pipe tests: Rename program. * tests/test-spawn-pipe-main.c: Renamed from tests/test-spawn-pipe.c. * tests/test-spawn-pipe-child.c: Update comment. * tests/test-spawn-pipe.sh: Update. * modules/spawn-pipe-tests (Files, Makefile.am): Update.
Bruno Haible 8a1f6249 2011-06-06T11:38:40 spawn-pipe tests: Like the child program only against libc. * tests/test-spawn-pipe-child.c: New file, extracted from tests/test-spawn-pipe.c. (main): Expect only one argument. (is_open): New function, copied from tests/test-pipe.c. * tests/test-spawn-pipe.c: Don't include <errno.h>. (child_main): Remove function. (test_pipe): Pass only one argument to the child program. (main): Remove child process code. Expect the child program's name as first argument. * tests/test-spawn-pipe.sh: Pass the child program's name as first argument. * modules/spawn-pipe-tests (Files): Add tests/test-spawn-pipe-child.c. (Makefile.am): Add test-spawn-pipe-child to check_PROGRAMS. Link test-spawn-pipe-child against no libraries.
Bruno Haible e7754b0a 2011-06-05T20:08:15 acl: Fix test failure on AIX 7. * tests/test-sameacls.c (main) [AIX]: Fix aclx_printStr invocation. Based on a patch by Jørn Amundsen <Jorn.Amundsen@ntnu.no>.
Bruno Haible 64e33838 2011-06-03T00:10:00 pipe2: Remove dependency on 'nonblocking' module. * lib/pipe2.c: Include verify.h. Include nonblocking.h only if O_NONBLOCK is defined by gnulib. (pipe2) [WIN32]: If O_NONBLOCK is not defined by gnulib, verify that it is zero. * modules/pipe2 (Depends-on): Add verify. Remove nonblocking. * tests/test-pipe2.c: Include nonblocking.h only if O_NONBLOCK is defined by gnulib. (get_nonblocking_flag): New function. (main): Test O_NONBLOCK flag only if it is nonzero.
Paul Eggert 9d196fad 2011-05-24T16:47:01 test-intprops: disable -Wtype-limits diagnostics * tests/test-intprops.c: Use a pragma to ignore -Wtype-limits diagnostics. Otherwise, the integer overflow macros generate many diagnostics. Reported by Jim Meyering in <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00528.html>.
Eric Blake d1608870 2011-05-24T17:16:00 closein-tests: convert to init.sh * modules/closein-tests (Files): Add init.sh * tests/test-closein.sh Use it. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 6ff1e786 2011-05-24T16:54:17 yesno-tests: convert to init.sh * modules/yesno-tests (Files): Add init.sh. * tests/test-yesno.sh: Use it. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake fc9b0f6c 2011-05-24T16:42:37 atexit-tests: ensure reliable exit status This was the only remaining init.sh client that didn't properly use the 'Exit' function. * tests/test-atexit.sh: Prefer 'Exit' over 'exit'. Reported by Bruno Haible. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 3a3fe58b 2011-05-18T15:19:51 strerror_r: enforce POSIX recommendations POSIX recommends (but does not require) that strerror_r populate buf even on error. But since we guarantee this behavior for strerror, we might as well also guarantee it for strerror_r. * lib/strerror_r.c (safe_copy): New helper method. (strerror_r): Guarantee a non-empty string. * tests/test-strerror_r.c (main): Enhance tests to incorporate recent POSIX rulings and to match our strerror guarantees. * doc/posix-functions/strerror_r.texi (strerror_r): Document this. Signed-off-by: Eric Blake <eblake@redhat.com>
Jim Meyering 734bedd1 2011-05-24T21:28:46 test-perror2.c: avoid warning about unused variable * tests/test-perror2.c (main): Remove declaration of unused "fp".
Eric Blake 9d3a2863 2011-05-24T10:14:52 perror: avoid spurious test failure on HP-UX The previous command has non-zero status. Even though 'exit 0' is supposed to ignore prior status, HP-UX /bin/sh favors the prior status if an exit trap is installed. * tests/test-perror.sh: Use Exit to avoid wrong exit status. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 866bbaee 2011-05-24T10:04:46 tests: fix logic bug in init.sh If the shell test loop first finds a marginal then a good shell, the variable $gl_set_x_corrupts_stderr is still set to true and needlessly drops $VERBOSE logging. * tests/init.sh: (gl_set_x_corrupts_stderr_): Clear for successful shell. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 2f035758 2011-05-21T10:08:28 strerror_r: avoid clobbering strerror on cygwin Avoid cygwin strerror_r, since it clobbers strerror buffer through cygwin 1.7.9. __xpg_strerror_r is okay, but if a program is compiled on cygwin 1.7.8 or earlier, it is not available. * lib/strerror_r.c (strerror_r): Don't use cygwin's strerror_r; fall back instead to sys_errlist. * modules/strerror (configure.ac): Add witness. * tests/test-strerror_r.c (main): Enhance test. * doc/posix-functions/strerror_r.texi (strerror_r): Document it. * tests/test-perror2.c (main): Free memory before exit. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 88dabde4 2011-05-20T11:09:53 perror: work around FreeBSD bug POSIX requires that 'errno = 0; perror ("")' print the same message as strerror(0), but this failed if we were replacing strerror to work around the FreeBSD bug of treating 0 as a failure. The goal here is to _not_ replace perror on glibc, even though strerror_r has to be replaced, because the strerror_r replacement is only for the sake of correcting the signature rather than working around bugs in the handling of any particular errnum value. Recall that $gl_cv_func_strerror_r_works is only set if the POSIX signature was detected in the first place. * m4/perror.m4 (gl_FUNC_PERROR): Also replace perror if strerror_r is broken. Move AC_LIBOBJ... * modules/perror (configure.ac): Here. * doc/posix-functions/perror.texi (perror): Document this. * tests/test-perror2.c (main): Enhance test. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake c0fb797b 2011-05-20T10:42:26 test-perror: check for strerror interactions This uncovered a glibc bug, although not many people check for perror failures, so for now I'm not working around it. http://sourceware.org/bugzilla/show_bug.cgi?id=12792 * tests/macros.h (STREQ) Add macro. * modules/perror-tests (Files): Add second test. * tests/test-perror2.c (main): New file. * doc/posix-functions/perror.texi (perror): Document glibc bug. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 98c78cdf 2011-05-20T08:57:54 test-perror: rewrite to use init script Make the test simpler, and also check for correct exit status. * modules/perror-tests (Files): Add init.sh. * tests/test-perror.sh: Use temporary directory. Signed-off-by: Eric Blake <eblake@redhat.com>
Paul Eggert 1e0b92c9 2011-05-19T19:16:43 intprops-tests: work around HP-UX 11.23 cc bug with constants * tests/test-intprops.c (VERIFY): New macro. (main): Use it, instead of verify, to work around the compiler bug; see <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>.
Paul Eggert 55abd317 2011-05-19T19:15:19 intprops-tests: revert unsigned part of previous change * tests/test-intprops.c (UINT_MAX, ULONG_MAX, UINTMAX_MAX, U0, U1): Remove; they weren't actually needed. All uses of U0 and U1 removed, and other casts to 'unsigned int' reverted to 'u' suffixes. See <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>.
Eric Blake 7f4877b4 2011-05-19T13:35:39 strerror_r: guarantee unchanged errno POSIX guarantees that strerror doesn't change errno on success, and since we implement strerror by using strerror_r, it makes sense to make the same guarantee for strerror_r (rather, going one step further to say that sterror_r does not corrupt errno, since it returns an error value explicitly). See also http://austingroupbugs.net/view.php?id=447 * lib/strerror_r.c (strerror_r): Guarantee unchanged errno. * lib/strerror-impl.h (strerror): Set errno to match strerror_r failure. * tests/test-strerror_r.c (main): Enhance test. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake d1187148 2011-05-19T10:17:18 strerror: relax test for Solaris Solaris returns "Error 0" for 0 vs. "Unknown error" for -1; while that does not quite have the positive connotation that POSIX recommends, it is distinct enough that we do not need to replace the native strerror just to pick a better string. The test is really trying to reject implementations that use the same string for both 0 and 1 (modulo any %d output of the error number). * tests/test-strerror.c (main): Permit Solaris behavior. * tests/test-strerror_r.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 1608fbc0 2011-05-18T18:16:59 strerror: enforce POSIX ruling on strerror(0) http://austingroupbugs.net/view.php?id=382 requires that strerror(0) succeed, but FreeBSD reports "Unknown error: 0" and fails with EINVAL. * m4/strerror.m4 (gl_FUNC_STRERROR_SEPARATE): Expose BSD bug. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Likewise. * lib/strerror_r.c (rpl_strerror_r): Work around it. * doc/posix-functions/strerror.texi (strerror): Document it. * doc/posix-functions/strerror_r.texi (strerror_r): Likewise. * tests/test-strerror.c (main): Strengthen test. * tests/test-strerror_r.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Paul Eggert 4b0606ce 2011-05-19T01:43:17 intprop-tests: port to older and more-pedantic compilers * modules/intprops-tests (Files): Add tests/macros.h. * tests/test-intprops.c: Include macros.h. (TYPE_IS_INTEGER): Use ASSERT, not verify, to test this macro, as it's no longer documented to expand to an integer constant expression. (TYPE_SIGNED): Use ASSERT, not verify, to test this macro when the argument is floating point, as it's no longer documented to expand to an integer constant expression in that case. (UINT_MAX, ULONG_MAX, UINTMAX_MAX): Redefine to work around compiler bugs reported by Bruno Haible. See <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. (U0, U1): New constants, to work around the same bugs. Also, in tests, use e.g., "(unsigned int) 39" rather than "39u".
Paul Eggert 7509e3c4 2011-05-15T09:37:21 intprops-tests: new module * modules/intprops-tests, tests/test-intprops.c: New files.
James Youngman 533fd9ce 2011-05-12T22:14:12 fnmatch: add a test for glibc's Bugzilla bug #12378 * m4/fnmatch.m4: Use gnulib's fnmatch if the system fnmatch doesn't allow the literal matching of a lone "[" (which is required by POSIX). * tests/test-fnmatch.c (main): Check that "[/b" matches itself.
Eric Blake c6dc8f16 2011-05-13T10:26:08 getcwd-lgpl: relax test for FreeBSD getcwd(NULL, 1) mallocs a larger buffer on BSD, rather than failing with ERANGE as on glibc. This behavior difference is not worth coding around, as it is an uncommon use of getcwd in the first place. * doc/posix-functions/getcwd.texi (getcwd): Document portability issue. * tests/test-getcwd-lgpl.c (main): Relax test. Reported by Matthias Bolte. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 4104cd4f 2011-05-11T19:33:46 test-fflush: silence compiler warning Detected by clang. * tests/test-fflush.c (main): Don't fclose a NULL pointer. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible fae7fdcf 2011-05-12T02:03:07 group-member: Declare function in <unistd.h>. * lib/unistd.in.h (group_member): New declaration. * lib/group-member.h: Remove file. * lib/group-member.c: Include <unistd.h> instead of group-member.h. * tests/test-unistd-c++.cc: Check signature of group_member. * m4/group-member.m4 (gl_FUNC_GROUP_MEMBER): Require gl_UNISTD_H_DEFAULTS. Set HAVE_GROUP_MEMBER. * m4/unistd_h.m4 (gl_UNISTD_H): Check whether group_member is declared. (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GROUP_MEMBER, HAVE_GROUP_MEMBER. * modules/group-member (Files): Remove lib/group-member.h. (Depends-on): Add unistd. Specify conditions. (configure.ac): Invoke gl_UNISTD_MODULE_INDICATOR. (Include): Change to <unistd.h>. * modules/unistd (Makefile.am): Substitute GNULIB_GROUP_MEMBER, HAVE_GROUP_MEMBER. * NEWS: Mention the change. * lib/euidaccess.c: Don't include group-member.h.
Paul Eggert f40658a3 2011-05-08T11:53:53 intprops: switch to usual gnulib indenting and naming * lib/intprops.h (_GL_INTPROPS_H): Rename from GL_INTPROPS_H. (_GL_SIGNED_TYPE_OR_EXPR): Rename from signed_type_or_expr__. * tests/test-inttostr.c (IS_TIGHT): Adjust to above renaming.
Eric Blake 3606b90f 2011-05-06T13:01:17 fclose: guarantee behavior on seekable stdin * modules/fclose (Depends-on): Add fflush. * doc/posix-functions/fclose.texi (fclose): Document this. * tests/test-fclose.c (main): Make test for this unconditional. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake cc9b4baf 2011-05-03T15:27:11 test-getaddrinfo: report error information Clang deduced that if ENABLE_DEBUGGING is undefined, then err was a dead assignment. But in the EAI_SYSTEM case, we fail the test, so the output should be unconditional. * tests/test-getaddrinfo.c (simple): Use err outside of dbprintf. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake bcbcf0c5 2011-05-02T15:00:50 fflush: also replace fclose when fixing fflush This fixes the fclose failures detected in the previous patch, but only when the GPL fflush module is also in use. That is because the need for behavior of resetting seekable input streams is much less common, and the fix more complex. The LGPLv2+ test for fclose() in isolation is relaxed to pass if fflush is not being replaced to cater to input streams. * modules/fflush (Depends-on): Add fclose. * m4/fflush.m4 (gl_FUNC_FFLUSH): Also replace fclose. * lib/fclose.c (rpl_fclose): Don't cause spurious failures on memstreams with no backing fd. * doc/posix-functions/fclose.texi (fclose): Document the use of fflush module to fix the bug. * tests/test-fclose.c (main): Relax test when fclose is used in isolation. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 1fc3525d 2011-05-02T13:38:23 fclose: add some tests POSIX requires that fclose() on seekable input streams rewind back to the next byte not actually given to the application. Glibc fails this test. See: http://sourceware.org/bugzilla/show_bug.cgi?id=3746 http://sourceware.org/bugzilla/show_bug.cgi?id=12724 Likewise for FreeBSD. Cygwin 1.7.9 and Solaris 10 pass, however. * modules/fclose-tests: New test module. * tests/test-fclose.c: New file. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible 0576d587 2011-04-30T15:00:45 netdb: Make it work in C++ mode. * lib/netdb.in.h (struct addrinfo): In C++, define as a C struct. (getaddrinfo, freeaddrinfo, getnameinfo): Use macros from c++defs module. * m4/netdb_h.m4 (gl_NETDB_MODULE_INDICATOR): Invoke gl_MODULE_INDICATOR_FOR_TESTS. * modules/netdb-tests (Depends-on): Add netdb-c++-tests. * modules/netdb-c++-tests: New file. * tests/test-netdb-c++.cc: New file.
Jim Meyering c1bb7ba6 2011-04-29T09:53:25 test-getcwd.c: avoid new set-but-not-used warning * tests/test-getcwd.c (test_abort_bug): Exit nonzero for any problem, not just the glibc/abort one that getcwd-abort-bug.m4 detects. This also adds an additional test for an unlikely chdir("..") failure. * m4/getcwd-abort-bug.m4: Update this now-duplicated code to match, and adjust the code that sets gl_cv_func_getcwd_abort_bug accordingly.
Jim Meyering 20abe9a9 2011-04-29T09:38:14 test-hash.c: avoid a new shadowing warning * tests/test-hash.c (main): Don't shadow "dup".
Eric Blake d6d01fdd 2011-04-27T16:38:05 tests: drop unused link dependency Ever since commit 2392b18099, openat and fdopendir no longer drag in xalloc-die through indirect dependencies, so these tests no longer need $(LIBINTL). * modules/areadlinkat-tests (Makefile.am): Drop stale LDADD. * modules/dirent-safer-tests (Makefile.am): Likewise. * modules/fdopendir-tests (Makefile.am): Likewise. * modules/mkfifoat-tests (Makefile.am): Likewise. * modules/openat-safer-tests (Makefile.am): Likewise. * modules/openat-tests (Makefile.am): Likewise. * modules/readlinkat-tests (Makefile.am): Likewise. * modules/symlinkat-tests (Makefile.am): Likewise. * modules/linkat-tests (Makefile.am): Likewise. (Depends-on): Switch to filenamecat-lgpl. * modules/fdutimensat-tests (test_fdutimensat_LDADD): Drop unused LIBINTL. * modules/utimensat-tests (test_utimensat_LDADD): Likewise. * tests/test-linkat.c (main): Don't require xalloc. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 83b1d641 2011-04-27T16:23:45 hash, mgetgroups: drop xalloc dependency Rely on the new xalloc-oversized module to avoid requiring xalloc-die for functions documented as returning NULL on potential allocation overflow. * lib/hash.c (includes): Adjust includes. * lib/mgetgroups.c (includes): Likewise. (xgetgroups): Move... * lib/xgetgroups.c: ...to new file. * modules/xgetgroups: New file, split from... * modules/mgetgroups: ...here. (Depends-on): Add xalloc-oversized. * modules/hash (Depends-on): Likewise. * modules/hash-tests (Depends-on): Drop xalloc. (test_hash_LDADD): Drop unused library. * tests/test-hash.c (main): Break xalloc dependency. (includes): Drop unused include. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake a2772ebc 2011-04-26T15:23:23 tests: reduce dependencies We can assume that tests won't be run from a directory with an absolute name longer than native getcwd limits. * tests/test-linkat.c (main): Use lighter-weight getcwd. * tests/test-renameat.c (main): Likewise. * modules/linkat-tests (Depends-on): Relax dependency. * modules/renameat-tests (Depends-on): Likewise. * modules/fchdir-tests (Depends-on): Likewise. Also make cloexec dependency explicit. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 02923aad 2011-04-26T14:51:24 getcwd: enhance tests The existing getcwd was weak, and only tested things guaranteed by the new getcwd-lgpl. Move those tests into a new file and strengthen them slightly (such as guaranteeing the ERANGE error for a non-zero but too-small size). Then copy the m4 tests for PATH_MAX failures into the GPL getcwd tests, to prove that our replacement really is fixing the things that cause us to reject the system getcwd as non-robust. * tests/test-getcwd-lgpl.c: New file, taken from... * tests/test-getcwd.c: ...old contents. Rewrite this file to repeat long path stress tests from m4 probe. * modules/getcwd-lgpl-tests: New module. * modules/getcwd-tests (Depends-on): Depend on lgpl tests. * m4/getcwd-abort-bug.m4: Update comment. * m4/getcwd-path-max.m4: Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 06d76f63 2011-04-21T07:16:20 passfd: allow compilation on mingw The passfd module now skips on mingw, rather than failing to compile. It may be nice to add a sendmsg and recvmsg module in the future, but for now passfd is the only client that cares. * modules/sys_socket (Depends-on): Add sys_uio. * lib/sys_socket.in.h [!@HAVE_SYS_SOCKET_H@]: Use it for struct iovec and a minimal struct msghdr. * tests/test-sys_socket.c (main): Enhance test. * m4/afunix.m4 (gl_SOCKET_AFUNIX): Detect recvmsg/sendmsg. * lib/passfd.c (include): Drop <sys/uio.h>; <sys/sockets.h> is guaranteed to provide what we need. (sendmsg, recvmsg): Declare fallbacks if we lack sendmsg. * modules/passfd-tests (Depends-on): Add sys_wait. * tests/test-passfd.c (main): Skip test on mingw, for now. * doc/posix-headers/sys_socket.texi (sys/socket.h): Document the partial 'struct msghdr' implementation. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 753425d5 2011-04-21T08:51:12 sys_uio: new module For now, just provide the types used by sys/socket. We could add readv() and writev() later, if desired. * modules/sys_uio: New module. * modules/sys_uio-tests: Likewise. * lib/sys_uio.in.h: New file. * m4/sys_uio_h.m4: Likewise. * tests/test-sys_uio.c: Likewise. * doc/posix-headers/sys_uio.texi (sys/uio.h): Document it. * MODULES.html.sh (systems lacking POSIX:2008): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible 6110d07d 2011-04-18T02:34:47 ioctl: Remove link dependency on native Windows. * lib/fd-hook.h: Renamed from lib/close-hook.h. (gl_close_fn, gl_ioctl_fn): New types. (struct fd_hook): Renamed from struct close_hook. Change type of private_close_fn field. Add private_ioctl_fn field. (close_hook_fn): Add parameter for primary close method. (execute_close_hooks, execute_all_close_hooks): Likewise. (ioctl_hook_fn): New type. (execute_ioctl_hooks, execute_all_ioctl_hooks): New declarations. (register_fd_hook): Renamed from register_close_hook. Add ioctl_hook argument. (unregister_fd_hook): Renamed from unregister_close_hook. * lib/fd-hook.c: Renamed from lib/close-hook.c. Don't include <unistd.h>. (close): Remove undef. (anchor): Update. (execute_close_hooks): Add argument for primary close method. (execute_all_close_hooks): Likewise. (execute_ioctl_hooks, execute_all_ioctl_hooks): New functions. (register_fd_hook): Renamed from register_close_hook. Add ioctl_hook argument. Allow each argument to be NULL. (unregister_fd_hook): Renamed from unregister_close_hook. * lib/close.c (rpl_close): Pass 'close' function pointer to execute_all_close_hooks. * lib/ioctl.c: Include <errno.h>, fd-hook.h. (primary_ioctl): New function. (ioctl): Don't call ioctlsocket here. Instead, call execute_all_ioctl_hooks. * lib/sockets.c (close_fd_maybe_socket): Add argument for primary close method. (ioctl_fd_maybe_socket): New function, with code from lib/ioctl.c. (fd_sockets_hook): Renamed from close_sockets_hook. (gl_sockets_startup, gl_sockets_cleanup): Update. * modules/fd-hook: Renamed from modules/close-hook. Update. * modules/close (Depends-on): Add fd-hook, remove close-hook. * modules/sockets (Depends-on): Likewise. * modules/ioctl (Depends-on): Add fd-hook. * tests/test-nonblocking.c (main): Use GNULIB_TEST_SOCKET, not GNULIB_SOCKET.
Bruno Haible 05414bd2 2011-04-18T10:46:53 nonblocking tests: Tweak comment.
Bruno Haible bce9d2f2 2011-04-17T19:50:10 nonblocking: Add tests for sockets. * tests/test-nonblocking-socket.sh: New file. * tests/test-nonblocking-socket-main.c: New file. * tests/test-nonblocking-socket-child.c: New file. * tests/test-nonblocking-socket.h: New file. * tests/socket-server.h: New file. * tests/socket-client.h: New file. * modules/nonblocking-socket-tests: New file. * modules/nonblocking-tests (Depends-on): Add nonblocking-socket-tests.
Bruno Haible 8a0661a8 2011-04-17T19:27:28 nonblocking: Add tests for pipes. * tests/test-nonblocking-pipe.sh: New file. * tests/test-nonblocking-pipe-main.c: New file. * tests/test-nonblocking-pipe-child.c: New file. * tests/test-nonblocking-pipe.h: New file. * tests/test-nonblocking-writer.h: New file. * tests/test-nonblocking-reader.h: New file. * tests/test-nonblocking-misc.h: New file. * modules/nonblocking-pipe-tests: New file. * modules/nonblocking-tests (Depends-on): Add nonblocking-pipe-tests.
Bruno Haible acc203f3 2011-04-15T01:02:13 Support non-blocking pipe I/O in read() on native Windows. * lib/unistd.in.h: Include <sys/types.h> also for 'read'. (read): New declaration. * lib/read.c: New file. * lib/stdio.in.h (_GL_ATTRIBUTE_FORMAT_SCANF, _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM): New macros. (fgetc, fgets, fread, fscanf, getc, getchar, gets, scanf, vfscanf, vscanf): New declarations. * lib/stdio-read.c: New file. * m4/read.m4: New file. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_READ, REPLACE_READ. * m4/stdio_h.m4 (gl_STDIO_H): Set GNULIB_FGETC, GNULIB_FGETS, GNULIB_FREAD, GNULIB_FSCANF, GNULIB_GETC, GNULIB_GETCHAR, GNULIB_GETS, GNULIB_SCANF, GNULIB_VFSCANF, GNULIB_VSCANF. In non-blocking I/O is desired and needs workarounds, set REPLACE_STDIO_READ_FUNCS. (gl_STDIO_H_DEFAULTS): Initialize GNULIB_FGETC, GNULIB_FGETS, GNULIB_FREAD, GNULIB_FSCANF, GNULIB_GETC, GNULIB_GETCHAR, GNULIB_GETS, GNULIB_SCANF, GNULIB_VFSCANF, GNULIB_VSCANF, REPLACE_STDIO_READ_FUNCS. * modules/read: New file. * modules/nonblocking (Files): Add lib/stdio-read.c. * modules/unistd (Makefile.am): Substitute GNULIB_READ, REPLACE_READ. * modules/stdio (Makefile.am): Substitute GNULIB_FGETC, GNULIB_FGETS, GNULIB_FREAD, GNULIB_FSCANF, GNULIB_GETC, GNULIB_GETCHAR, GNULIB_GETS, GNULIB_SCANF, GNULIB_VFSCANF, GNULIB_VSCANF, REPLACE_STDIO_READ_FUNCS. * modules/pread (Depends-on): Add read. * modules/safe-read (Depends-on): Likewise. * tests/test-stdio-c++.cc (fgetc, fgets, fread, fscanf, getc, getchar, gets, scanf, vfscanf, vscanf): Verify signatures. * doc/posix-functions/read.texi: Mention 'nonblocking' module and problem with non-blocking pipes. * doc/posix-functions/fgetc.texi: Likewise. * doc/posix-functions/fgets.texi: Likewise. * doc/posix-functions/fread.texi: Likewise. * doc/posix-functions/fscanf.texi: Likewise. * doc/posix-functions/getc.texi: Likewise. * doc/posix-functions/getchar.texi: Likewise. * doc/posix-functions/gets.texi: Likewise. * doc/posix-functions/scanf.texi: Likewise. * doc/posix-functions/vfscanf.texi: Likewise. * doc/posix-functions/vscanf.texi: Likewise.
Jim Meyering f9e83fd4 2011-04-10T09:56:02 maint: remove doubled words in comments, e.g., s/a a/a/ * lib/strptime.c (day_of_the_week): s/the the/the/ * tests/test-chown.h (test_chown): s/a a/a/
Jim Meyering 5e29a7a0 2011-04-10T09:30:22 test-chown.h: correct a cast * tests/test-chown.h (test_chown): Cast -1 to gid_t (not uid_t) when the destination is a stat.st_gid.
Jim Meyering 135351c5 2011-04-09T23:18:59 maint: change "a a" to "a" * tests/test-lchown.h (test_lchown): s/a a/a/
Eric Blake 4a1579d7 2011-04-08T11:51:45 nonblocking: reduce dependency No need to make nonblocking drag in sockets just for a test; test them if they are present and skip them otherwise. * tests/test-nonblocking.c: Only test sockets when in use. * modules/nonblocking-tests (Depends-on): Drop socket. (Makefile.am): Link even if sockets are not present. * modules/pipe2-tests (Makefile.am): Likewise. * lib/ioctl.c (ioctl) [WIN32]: Fail if sockets are not also in use. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 0568a6e8 2011-04-08T10:52:55 pipe2: fix O_NONBLOCK support on mingw * modules/pipe2 (Depends-on): Add nonblocking. * lib/pipe2.c (pipe2) [WIN32]: Add O_NONBLOCK support. * tests/test-pipe2.c (is_nonblocking): Adjust test accordingly. * tests/test-nonblocking.c (main): Likewise. * modules/pipe2-tests (Makefile.am): Avoid link failure. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 70a72e0f 2011-04-08T10:15:54 nonblocking: provide O_NONBLOCK for mingw Mingw is the only known platform that lacks O_NONBLOCK (possibly via the alternate spelling O_NDELAY). But mingw also lacks any files where open() needs to enforce non-blocking behavior, and lacks openat(), so it is relatively simple to provide a non-zero flag. A future patches will make use of O_NONBLOCK for pipe2. * modules/nonblocking (Depends-on): Add open. (configure.ac): Set new witness macro. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Provide default for it. * modules/fcntl-h (Makefile.am): Substitute it. * lib/fcntl.in.h (O_NONBLOCK): Guarantee non-zero definition when nonblocking module is in use. * lib/nonblocking.c: Adjust portability test. * lib/open.c (open): Don't let native open see gnulib flag. * tests/test-fcntl-h.c (main): Enhance test. * tests/test-open.h (test_open): Likewise. * doc/posix-headers/fcntl.texi (fcntl.h): Document the replacement. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake dec34757 2011-03-31T15:28:37 nonblocking: fix mingw test failures Actually testing on mingw uncovered a few more problems. * lib/nonblocking.c (set_nonblocking_flag): Succeed when clearing non-blocking flag on regular file. (get_nonblocking_flag): Set errno on invalid fd. * tests/test-nonblocking.c (main): Avoid test failure on directories if fchdir is not active. * modules/nonblocking-tests (Depends-on): Drop unused dependency. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 111a4bf8 2011-03-30T22:07:20 nonblocking: new module * modules/nonblocking: New module. * modules/nonblocking-tests: Likewise. * lib/nonblocking.h: New file. * lib/nonblocking.c: Likewise. * tests/test-nonblocking.c: New test. * lib/ioctl.c (ioctl) [mingw]: Update comment. Signed-off-by: Eric Blake <eblake@redhat.com>