* dir.cc (rmdir): Reorganize check for trailing dot to return correct error
when directory does not exist.
This commit is contained in:
parent
324ce34bd5
commit
25bafd7b0e
@ -1,3 +1,8 @@
|
|||||||
|
2006-02-04 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* dir.cc (rmdir): Reorganize check for trailing dot to return correct
|
||||||
|
error when directory does not exist.
|
||||||
|
|
||||||
2006-02-03 Christopher Faylor <cgf@timesys.com>
|
2006-02-03 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
* dir.cc (mkdir): Reorganize check for trailing dot to return correct
|
* dir.cc (mkdir): Reorganize check for trailing dot to return correct
|
||||||
|
@ -295,12 +295,6 @@ rmdir (const char *dir)
|
|||||||
if (efault.faulted (EFAULT))
|
if (efault.faulted (EFAULT))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (has_dot_last_component (dir))
|
|
||||||
{
|
|
||||||
set_errno (EINVAL);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW)))
|
if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW)))
|
||||||
goto done; /* errno already set */;
|
goto done; /* errno already set */;
|
||||||
|
|
||||||
@ -309,8 +303,11 @@ rmdir (const char *dir)
|
|||||||
debug_printf ("got %d error from build_fh_name", fh->error ());
|
debug_printf ("got %d error from build_fh_name", fh->error ());
|
||||||
set_errno (fh->error ());
|
set_errno (fh->error ());
|
||||||
}
|
}
|
||||||
|
else if (has_dot_last_component (dir))
|
||||||
|
set_errno (fh->exists () ? EINVAL : ENOENT);
|
||||||
else if (!fh->rmdir ())
|
else if (!fh->rmdir ())
|
||||||
res = 0;
|
res = 0;
|
||||||
|
|
||||||
delete fh;
|
delete fh;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user