pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/42256: check-files with /usr/pkgsrc mounted read-only
The following reply was made to PR pkg/42256; it has been noted by GNATS.
From: Steven Drake <sdrake%xnet.co.nz@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: pkg/42256: check-files with /usr/pkgsrc mounted read-only
Date: Tue, 3 Nov 2009 20:37:11 +1300 (NZDT)
On Mon, 2 Nov 2009, Joerg Sonnenberger wrote:
>On Mon, Nov 02, 2009 at 12:40:02AM +0000, Steven Drake wrote:
> > Your suggesting that rm -f treats unlink(2) failures that return an EROFS
> > errno value specially, and by looking at the source's nether the coreutils
> > rm or the netbsd rm do.
>
> Yes, but the files shouldn't exist in first place. They are phony
> targets.
I remembered that there phony after I sent that email (Oops!).
Anyway I spent some more time looking at netbsd/coreutils rm sources (and
debugging the coreutils rm).
The netbsd rm does any fts_open/fts_read on the file and look at fts_info,
form the source:
/*
* FTS_NS: assume that if can't stat the file, it
* can't be unlinked.
*/
The coreutils rm does an unlinkat and checks the errno value on failure
ignoring it if its ENOENT. With linux/glibc (at least) unlinkat/unlink
sets errno to EROFS for a non-existent file on a read-only filesystem.
That begs the question, what should unlink set errno to? I like to know
what other OSes/libcs do?
In any case I'll submit this as a coreutils bug, (who know what it's
maintainers will think?), but it is probably easier to apply the patch I
sent.
--
Steven
Home |
Main Index |
Thread Index |
Old Index