Skip to content

Commit

Permalink
fix: also check for "EISDIR" in mkdirp
Browse files Browse the repository at this point in the history
Fixes webpack#10544.

Though the `EISDIR` error code is not mentioned in the POSIX standard,
FreeBSD and memfs both throws this error when trying to run `mkdir` on
`/`. So essentially we should treat it the same as `EEXIST`.

References:
* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=59739
* streamich/memfs#326
  • Loading branch information
sodatea committed Mar 12, 2020
1 parent 361cd7a commit 32d1bdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/fs.js
Expand Up @@ -141,7 +141,7 @@ const mkdirp = (fs, p, callback) => {
});
});
return;
} else if (err.code === "EEXIST") {
} else if (err.code === "EEXIST" || err.code === "EISDIR") {
callback();
return;
}
Expand Down

0 comments on commit 32d1bdf

Please sign in to comment.