Fix a bug introduced in rev.1.23 - for some reason mkdir("/", ...) system

call returns `EISDIR', not `EEXIST', so that be prepared for that. This should
fix number of ports, that often call `mkdir -p //usr/local/foobar'. This
is just a quick workaround, the real fix would be either to avoid calling
mkdir("/", ...) or fix VFS code to return consistent errno for this case.
This commit is contained in:
Maxim Sobolev 2002-02-25 09:17:44 +00:00
parent 2ca2159f22
commit 42d6cdd371
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91235

View File

@ -174,7 +174,7 @@ build(char *path, mode_t omode)
if (last)
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
if (errno == EEXIST) {
if (errno == EEXIST || errno == EISDIR) {
if (stat(path, &sb) < 0) {
warn("%s", path);
retval = 1;