read() expects B_IS_A_DIRECTORY on directories that can't be read.

This fixes grep misbehavior with directories.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26186 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2008-06-30 23:06:41 +00:00
parent 774e87aac9
commit fdf3fa9fe1

View File

@ -1179,6 +1179,8 @@ bfs_read(fs_volume *_volume, fs_vnode *_node, void *_cookie, off_t pos,
if (!inode->HasUserAccessableStream()) {
*_length = 0;
if (inode->IsDirectory())
RETURN_ERROR(B_IS_A_DIRECTORY);
RETURN_ERROR(B_BAD_VALUE);
}