Re: mingw remove bug

2009-09-17 Thread Jim Meyering
Eric Blake wrote: > Jim Meyering meyering.net> writes: > >> > Meanwhile, the rmdir-errno module, in use by coreutils until today, guessed >> > wrong for cross-compilation to Solaris (where rmdir fails with EEXIST, not >> > ENOTEMPTY, on a populated directory); now that coreutils no longer uses th

Re: mingw remove bug

2009-09-16 Thread Eric Blake
Jim Meyering meyering.net> writes: > > Meanwhile, the rmdir-errno module, in use by coreutils until today, guessed > > wrong for cross-compilation to Solaris (where rmdir fails with EEXIST, not > > ENOTEMPTY, on a populated directory); now that coreutils no longer uses the > > module [1], I see n

Re: mingw remove bug

2009-09-16 Thread Jim Meyering
Eric Blake wrote: > Eric Blake byu.net> writes: >> > I'm arguing that the second program should also report "No such >> > file or directory". >> >> Ah, so for 'foo/', the code should distinguish between ENOENT and ENOTDIR, >> based on whether 'foo' exists. I'll update the patch and test according

Re: mingw remove bug

2009-09-16 Thread Eric Blake
Eric Blake byu.net> writes: > > I'm arguing that the second program should also report "No such > > file or directory". > > Ah, so for 'foo/', the code should distinguish between ENOENT and ENOTDIR, > based on whether 'foo' exists. I'll update the patch and test accordingly. I'm taking a step

Re: mingw remove bug

2009-09-14 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Ben Pfaff on 9/14/2009 8:42 PM: > > I'm arguing that the second program should also report "No such > file or directory". Ah, so for 'foo/', the code should distinguish between ENOENT and ENOTDIR, based on whether 'foo' exists. I'll upd

Re: mingw remove bug

2009-09-14 Thread Ben Pfaff
Eric Blake writes: > According to Ben Pfaff on 9/14/2009 5:51 PM: >>> + /* Mingw remove("file/") fails with EINVAL, instead of the required >>> + ENOTDIR. */ >>> + if (ISSLASH (name[len - 1])) >>> +{ >>> + errno = ENOTDIR; >>> + return -1; >>> +} >> >> I believe that thi

Re: mingw remove bug

2009-09-14 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Ben Pfaff on 9/14/2009 5:51 PM: >> + /* Mingw remove("file/") fails with EINVAL, instead of the required >> + ENOTDIR. */ >> + if (ISSLASH (name[len - 1])) >> +{ >> + errno = ENOTDIR; >> + return -1; >> +} > > I b

Re: mingw remove bug

2009-09-14 Thread Ben Pfaff
Eric Blake writes: > + if (lstat (name, &st) == 0 && S_ISDIR (st.st_mode)) > +{ > + /* Mingw rmdir("empty/.") mistakenly succeeds. */ > + while (ISSLASH (name[len - 1])) > +len--; > + if (name[len - 1] == '.' && (1 == len || ISSLASH (name[len - 2]))) > +{ > +

mingw remove bug

2009-09-14 Thread Eric Blake
mingw remove() complies with C89, but not with POSIX. I'll be committing this shortly (actually, first I probably need to commit a stat module, to make up for the fact that both mingw rmdir("dir") and rmdir("dir/") can succeed, even when one of stat("dir") and stat("dir/") fails, depending on w