[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unlink test failure on MacOS X
From: |
Eric Blake |
Subject: |
Re: unlink test failure on MacOS X |
Date: |
Wed, 17 Mar 2010 11:06:12 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3 |
On 03/14/2010 06:16 PM, Bruno Haible wrote:
> The reason is that unlink("..") returns 0 without having done any side effects
> on the file system. Likewise for unlink("../..").
>
> Test program:
> ========================= foo.c ========================
> #include <errno.h>
> #include <stdio.h>
> #include <unistd.h>
> int main ()
> {
> int ret = unlink ("../..");
> printf ("%d %d\n", ret, errno);
> return 0;
> }
> ========================================================
>
> This prints
> -1 21 [EISDIR]
> on Linux, but
> 0 0
> on MacOS X.
Which version of MacOS X? What does uname state? What file system?
I cannot reproduce it on the machine I have access to, tested on an nfs
mount (where built) and hfs mount (/tmp):
$ uname -v
Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009;
root:xnu-1228.15.4~1/RELEASE_I386
$ ./foo
-1 1
$ cd /tmp
$ ~/foo
-1 16
The fact that it may be file-system dependent makes the fix trickier -
we now have to test hostname and assume that MacOS is broken, because it
is no longer possible to assume that the fs used during ./configure is
representative of other fs available on the system.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature