]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
Make cg_mkdir_p() function compatible with read-only fs
authorPeter Schiffer <pschiffe@redhat.com>
Thu, 16 May 2013 15:10:32 +0000 (17:10 +0200)
committerPeter Schiffer <pschiffe@redhat.com>
Thu, 16 May 2013 15:10:32 +0000 (17:10 +0200)
commit74b3eb1db015fce921e0d450a66e13af2edec99f
tree308c902df409500f001c9e9929be23afb4d2b1dd
parenta4bd0b91c89e0856e91bfbcb906989f22ce26c2d
Make cg_mkdir_p() function compatible with read-only fs

mkdir(2) function returns EROFS error even when the path already exists on
the read only file system, so it is impossible to determine whether the path
already exists on this kind of fs only be return code from the mkdir(2). To make
cg_mkdir_p() compatible with the ro fs, the function checks whether the
path exists with stat(2) before trying to create it.

Signed-off-by: Peter Schiffer <pschiffe@redhat.com>
Acked-By: Jan Safranek <jsafrane@redhat.com>
src/api.c