From a22cca77f56ae4cac8726d7fad9b5ea4d8d8625a Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 4 Feb 2015 13:16:48 +0100 Subject: [PATCH] Fix extfs O_DIRECTORY error codes. --- ext/inode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/inode.cpp b/ext/inode.cpp index 98bed3c2..a2c7d087 100644 --- a/ext/inode.cpp +++ b/ext/inode.cpp @@ -396,14 +396,14 @@ Inode* Inode::Open(const char* elem, int flags, mode_t mode) file_type != EXT2_FT_UNKNOWN && file_type != EXT2_FT_DIR && file_type != EXT2_FT_SYMLINK ) - return errno = EEXIST, (Inode*) NULL; + return errno = ENOTDIR, (Inode*) NULL; Inode* inode = filesystem->GetInode(inode_id); if ( flags & O_DIRECTORY && !EXT2_S_ISDIR(inode->Mode()) && !EXT2_S_ISLNK(inode->Mode()) ) { inode->Unref(); - return errno = EEXIST, (Inode*) NULL; + return errno = ENOTDIR, (Inode*) NULL; } if ( S_ISREG(inode->Mode()) && flags & O_TRUNC ) inode->Truncate(0);