[PATCH] test-fsync: yet another enhancement

2011-09-16 Thread Eric Blake
* tests/test-fsync.c (main): Also test behavior on read-only text file. Signed-off-by: Eric Blake --- I've tested Linux so far, we'll see what testing on other platforms reveals. ChangeLog |6 ++ tests/test-fsync.c | 15 +++ 2 files changed, 21 insertions(+), 0 d

Re: [PATCH 1/2] test-fsync: enhance tests

2011-09-16 Thread Bruno Haible
Eric Blake wrote: > > Why not test both? Like this proposed patch. ... > > Looks good to me. Maybe we should also test reopening file in O_RDONLY > mode, since fsync on a tty is much different than fsync on a regular file. The idea of checking fd 0 is that it's likely in O_RDONLY mode. > POSIX

Re: mode_t on MSVC

2011-09-16 Thread Eric Blake
On 09/16/2011 03:44 PM, Bruno Haible wrote: On MSVC 9, I'm getting a syntax error in gnulib's here: static inline int rpl_mkdir (char const *name, mode_t mode) because mode_t is not defined. According to POSIX:2008, mode_t ought to be defined in each of (and other heade

mode_t on MSVC

2011-09-16 Thread Bruno Haible
On MSVC 9, I'm getting a syntax error in gnulib's here: static inline int rpl_mkdir (char const *name, mode_t mode) because mode_t is not defined. According to POSIX:2008, mode_t ought to be defined in each of (and other headers which gnulib does not support yet). Here's the fi

stat macros on MSVC

2011-09-16 Thread Bruno Haible
On MSVC 9, S_IFIFO and S_IFBLK are not defined, leading to compilation errors in tests/test-sys_stat.c. But _S_IFIFO is defined and can be used to define S_IFIFO. It appears ok to have a platform without S_IFBLK, so I'm relaxing the test in this respect: 2011-09-16 Bruno Haible sys_s

Re: off_t on MSVC

2011-09-16 Thread Eric Blake
On 09/16/2011 02:56 PM, Bruno Haible wrote: On MSVC 9, off_t is defined in and. It is not defined so far when is included. But POSIX:2008 wants off_t to be defined in each of Again, for the record, POSIX also requires off_t in these headers not yet wrapped by gnulib:

[PATCH] date: accept 'hence' as opposite of 'ago'

2011-09-16 Thread Eric Blake
* 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 --- > Since you've already got "AGO", it makes a great deal of sense to add > "HENCE" to parse-datetime so we can change the date li

Re: [PATCH 1/2] test-fsync: enhance tests

2011-09-16 Thread Eric Blake
On 09/16/2011 02:37 PM, Bruno Haible wrote: The original intent of that code was to test the behaviour of fsync on a read-only file descriptor, and STDIN_FILENO is one. Why should it be better to test STDOUT_FILENO? Why not test both? Like this proposed patch. (Which also add blank lines as sepa

off_t on MSVC

2011-09-16 Thread Bruno Haible
On MSVC 9, off_t is defined in and . It is not defined so far when is included. But POSIX:2008 wants off_t to be defined in each of This fixes it: 2011-09-16 Bruno Haible Support for MSVC compiler: Ensure off_t gets defined. * lib/unistd.in.h: Include .

Re: [PATCH 1/2] test-fsync: enhance tests

2011-09-16 Thread Bruno Haible
Eric Blake wrote: > > - if (fsync (0) != 0) > + if (fsync (STDOUT_FILENO) != 0) > { >ASSERT (errno == EINVAL /* POSIX */ >|| errno == ENOTSUP /* seen on MacOS X 10.5 */ >|| errno == EBADF /* seen on AIX 7.1 */ > - ); > + ); >

[PATCH] fdatasync: port to Solaris

2011-09-16 Thread Eric Blake
Cater to Solaris requiring extra libraries for fdatasync. * m4/fdatasync.m4 (gl_FUNC_FDATASYNC): Set LIB_FDATASYNC. * modules/fdatasync (Link): Document it. * modules/fdatasync-tests (test_fdatasync_LDADD): Link with it. Signed-off-by: Eric Blake --- I think this rounds out my fdatasync work fo

[PATCH] fdatasync: port to MacOS X 10.7

2011-09-16 Thread Eric Blake
MacOS X 10.7 added an fdatasync syscall and exports a symbol for it, but fails to declare it anywhere. Lacking any hard evidence that this syscall is broken, we will just provide the declaration and use it. * m4/fdatasync.m4 (gl_FUNC_FDATASYNC): Check for present but not declared. * m4/unistd_h.m

Re: one other coreutils test failure

2011-09-16 Thread Michael Stone
(dropped the cc by accident) - Forwarded message from Michael Stone - On Fri, Sep 16, 2011 at 09:02:20PM +0200, you wrote: Then maybe your system has problems with long names? What is errno when getcwd returns NULL here? also ENOENT /* If libc has the bug in question, this invocati

Re: one other coreutils test failure

2011-09-16 Thread Jim Meyering
Michael Stone wrote: > On Fri, Sep 16, 2011 at 06:54:32PM +0200, Jim Meyering wrote: >>Michael Stone wrote: >>> This one was actually in gnulib; what's the best way to pursue it? >>> >>> FAIL: test-getcwd (exit: 16) >>> >> >>Hi Michael, >> >>Thanks for the report. >>I'

Re: bug#9141: fdatasync module proposal

2011-09-16 Thread Paul Eggert
On 09/16/11 11:28, Eric Blake wrote: > Do we know this to be the case, or are you just going off of web searches? The latter. I just now tried to find that stuff again, and couldn't, so let's just ignore it for now. If the problem turns up again we can fix it later. The whole fsync/fdatasync/O_

verify-tests and NFS testing

2011-09-16 Thread Eric Blake
Every time I run a gnulib test on a Solaris 10 box with NFS home drive, it fails to remove the test directory. I've isolated it down to a minimal case: gnulib-tool --with-tests --test verify complains about: rm: cannot remove `testdir17481/gltests': File exists Sure enough, it leaves behind

Re: one other coreutils test failure

2011-09-16 Thread Michael Stone
On Fri, Sep 16, 2011 at 06:54:32PM +0200, Jim Meyering wrote: Michael Stone wrote: This one was actually in gnulib; what's the best way to pursue it? FAIL: test-getcwd (exit: 16) Hi Michael, Thanks for the report. I'll Cc bug-gnulib, but to start with, note that

[PATCH] fdatasync: minor improvements

2011-09-16 Thread Eric Blake
Picks up some ideas by Paul Eggert from here: https://lists.gnu.org/archive/html/bug-coreutils/2011-07/msg00157.html * modules/fdatasync (Depends-on): Add condition for fsync. * lib/fdatasync.c (fdatasync): Add comment. * tests/test-unistd-c++.cc: Test fdatasync. Signed-off-by: Eric Blake --- C

Re: one other coreutils test failure

2011-09-16 Thread Jim Meyering
Michael Stone wrote: > This one was actually in gnulib; what's the best way to pursue it? > > FAIL: test-getcwd (exit: 16) > Hi Michael, Thanks for the report. I'll Cc bug-gnulib, but to start with, note that test-getcwd.c's main does this: return test_abort_bug ()

Re: bug#9141: fdatasync module proposal

2011-09-16 Thread Eric Blake
On 07/22/2011 03:13 PM, Paul Eggert wrote: Surely coreutils is not the only program that will have problems with fdatasync on Mac OS. How about the following gnulib patches? Portability problems fixed by Gnulib: @itemize +@item +This function is present but undeclared and ineffective on

[PATCH] unistd: update refs to newer POSIX

2011-09-16 Thread Eric Blake
usleep only exists in POSIX 2001, but for the rest of the functions where we pointed to online POSIX specs, we might as well point to the latest version of the standard. * lib/unistd.in.h: Prefer POSIX 2008 over 2001. Suggested by Bruno Haible. Signed-off-by: Eric Blake --- Too bad the Open Gro

Re: [PATCH 2/2] fdatasync: new module

2011-09-16 Thread Eric Blake
On 09/16/2011 11:44 AM, Paul Eggert wrote: Thanks, did you have a look at my earlier proposed module for fdatasync, and Bruno's comments about it? It addresses some issues that your module does not, e.g., fdatasync is present but undeclared and ineffective on MacOS X 10.7. (I never got around to

Re: [PATCH 2/2] fdatasync: new module

2011-09-16 Thread Paul Eggert
Thanks, did you have a look at my earlier proposed module for fdatasync, and Bruno's comments about it? It addresses some issues that your module does not, e.g., fdatasync is present but undeclared and ineffective on MacOS X 10.7. (I never got around to pushing that earlier proposal, alas) ht

[PATCH 2/2] fdatasync: new module

2011-09-16 Thread Eric Blake
At least libvirt would like to use the lighter-weight fdatasync on platforms where it is supported, while still guaranteeing full sync (via the heavy-weight fsync fallback) on all platforms. I've got an open question to the Austin Group, since the POSIX 2008 wording is self-contradictory (unlike f

[PATCH 1/2] test-fsync: enhance tests

2011-09-16 Thread Eric Blake
This test failed to compile on mingw, which lacks ENOTSUP. Furthermore, it wasn't testing POSIX behavior on invalid fds. * modules/fsync-tests (Depends-on): Add errno, for mingw. * tests/test-fsync.c (main): Enhance test. Signed-off-by: Eric Blake --- ChangeLog |6 ++ modules