bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eric Blake
Subject: Re: [PATCH 1/2] test-fsync: enhance tests
Date: Fri, 16 Sep 2011 14:55:44 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110831 Fedora/3.1.12-2.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.12

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 separators, to make the test more readable.)

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.

POSIX requires fsync to work on read-only regular files, but I'm not sure if all implementations support that (if they don't, we could probably fake it by doing a no-op; read-only files can't be changing anything but atime metadata, which isn't the end of the world if it is not sync'd).

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]