Browse Source

handle EEXIST while cloning a path. closes #40

pull/42/head
Antonio SJ Musumeci 10 years ago
parent
commit
6276ce9779
  1. 9
      src/fs.cpp

9
src/fs.cpp

@ -424,7 +424,14 @@ namespace fs
topath = fs::make_path(tosrc,relative); topath = fs::make_path(tosrc,relative);
rv = ::mkdir(topath.c_str(),st.st_mode); rv = ::mkdir(topath.c_str(),st.st_mode);
if(rv == -1) if(rv == -1)
return -1;
{
if(errno != EEXIST)
return -1;
rv = ::chmod(topath.c_str(),st.st_mode);
if(rv == -1)
return -1;
}
rv = ::chown(topath.c_str(),st.st_uid,st.st_gid); rv = ::chown(topath.c_str(),st.st_uid,st.st_gid);
if(rv == -1) if(rv == -1)

Loading…
Cancel
Save