NetBSD/src uHKiM4Ftests/fs/vfs t_ro.c

   Initialise the sometvs array of struct timeval that is to be used to
   validate that utimes() cannot update the times of a file on a read only
   filesystem.   The values are never actually used, but since
        src/sys/kern/vfs_syscalls.c 1.535
   they are validated for sanity, and the syscall returns EINVAL if the
   values passed are invalid (tv_usec <0 or >= 1000000).  If that happens
   we don't get as far as the test which produces the EROFS that is expected
   from this test (these tests - one for each filesystem type).

   So, init the timeval structs (just to 0, the values will still not be
   used) so that the EINVAL doesn't bite us before we're eaten by the EROFS
   which is the way we're supposed to die.

   If the syscall API args were labelled as "const" the compiler probably
   would have caught the use of uninit'd vars and complained much sooner.
VersionDeltaFile
1.8+2-2tests/fs/vfs/t_ro.c
+2-21 files

UnifiedSplitRaw