On 08/25/2010 01:03 PM, Ralf Wildenhues wrote:
This is the output from 'truss ./test-rmdir':
[...]
rmdir("test-rmdir.tdir/file/")                  Err#20 ENOTDIR
rmdir("test-rmdir.tdir")                        Err#17 EEXIST
rmdir("test-rmdir.tdir/file")                   Err#20 ENOTDIR
unlink("test-rmdir.tdir/file")                  = 0
rmdir("test-rmdir.tdir/.//")                    Err#17 EEXIST
[...]

If I read Posix correctly, then EEXIST is not allowed for this
condition; not sure whether gnulib should work around this though.
Anyway the patch below lets the test pass.  Is it acceptable for gnulib?

Neither is EBUSY. But at least it fails (even if errno is wrong), so your patch is perfectly acceptable given what we've done for other syscalls with botched errno values. Feel free to apply it.

I've confirmed that the fix is needed for test-unlinkat as well.

Fixing test-rmdir.h should cover both test-rmdir and test-unlinkat in one go.

    ASSERT (func (BASE "dir/.//") == -1);
-  ASSERT (errno == EINVAL || errno == EBUSY);
+  ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST);
    ASSERT (func (BASE "dir") == 0);

--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to