reads now returns B_IS_A_DIRECTORY instead of B_BAD_VALUE for directories

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26267 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2008-07-05 22:26:21 +00:00
parent 165db546bf
commit 43eab982cf

View File

@ -436,8 +436,13 @@ reiserfs_read(fs_volume *fs, fs_vnode *_node, void *cookie, off_t pos,
*bufferSize));
status_t error = B_OK;
// don't read anything but files
if (!node->IsFile())
error = B_BAD_VALUE;
if (!node->IsFile()) {
if (node->IsDir())
error = B_IS_A_DIRECTORY;
else
error = B_BAD_VALUE;
}
// read
StreamReader *reader = (StreamReader*)cookie;
if (error == B_OK) {