lkml.org 
[lkml]   [2000]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUG] Inconsistent behaviour of rmdir
On Thu, Nov 16, 2000 at 02:47:35PM +0100, Jean-Marc Saffroy wrote:

> As you see, it looks like the rmdir fails simply because the dir name ends
> with a dot !! This is confirmed by sys_rmdir in fs/namei.c, around line
> 1384 :
>
> switch(nd.last_type) {
> case LAST_DOTDOT:
> error = -ENOTEMPTY;
> goto exit1;
> case LAST_ROOT: case LAST_DOT:
> error = -EBUSY;
> goto exit1;
> }

I see that an entire discussion has taken place. Let me just remark this,
quoting the Austin draft:

If the path argument refers to a path whose final component is either
dot or dot-dot, rmdir( ) shall fail.

EINVAL The path argument contains a last component that is dot.
EEXIST or ENOTEMPTY The path argument names a directory that is not an empty directory,
EBUSY The directory to be removed is currently in use by the system or some process
and the implementation considers this to be an error.

So, it seems that -EINVAL would be a better return value in case LAST_DOT.

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:47    [W:0.111 / U:3.412 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site