Commit 54bdc64a by Scott J. Goldman

Fix rmdir() usage on Solaris

On Solaris, rmdir() throws EEXIST if the folder is not empty, so just add
one more case to check for that, alongside ENOTEMPTY.
parent ec42eafd
...@@ -309,7 +309,7 @@ static int _rmdir_recurs_foreach(void *opaque, git_buf *path) ...@@ -309,7 +309,7 @@ static int _rmdir_recurs_foreach(void *opaque, git_buf *path)
return -1; return -1;
if (p_rmdir(path->ptr) < 0) { if (p_rmdir(path->ptr) < 0) {
if (removal_type == GIT_DIRREMOVAL_ONLY_EMPTY_DIRS && errno == ENOTEMPTY) if (removal_type == GIT_DIRREMOVAL_ONLY_EMPTY_DIRS && (errno == ENOTEMPTY || errno == EEXIST))
return 0; return 0;
giterr_set(GITERR_OS, "Could not remove directory '%s'", path->ptr); giterr_set(GITERR_OS, "Could not remove directory '%s'", path->ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment