[systemd-devel] [PATCH 2/2] tmpfiles: explicitly check for existing files

Lennart Poettering lennart at poettering.net
Mon Aug 18 06:34:16 PDT 2014


On Sun, 17.08.14 09:45, Michael Olbrich (m.olbrich at pengutronix.de) wrote:

> On read-only filesystems trying to create the target will not fail with
> EEXIST but with EROFS.

Hmm, what precisely fails with EROFS?

if there's an existing directory on some read-only fs, and we issue
mkdir() on it, then this will fail with EROFS you say?

if that's the case, then I#d really prefer if we could fix this by
checkinf if an mkdir() fails whether the destination already existed
anyway and then just continueing. i.e. mkdir() first, and if it fails,
then stat() it instead, and see if it already is a dir. And if so,
continue.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list