From 450b5c2c69ede24477ddba1ac74e87b5302a76fa Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 12 Jan 2005 14:21:01 +0000 Subject: [PATCH] Reverted the last change. As Axel informed me, rewinding queries will work under Haiku. Also check, whether the query was Fetch()ed already. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10698 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/Query.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/kits/storage/Query.cpp b/src/kits/storage/Query.cpp index 65ce5c4181..bc9286ef7e 100644 --- a/src/kits/storage/Query.cpp +++ b/src/kits/storage/Query.cpp @@ -630,15 +630,18 @@ BQuery::GetNextDirents(struct dirent *buf, size_t length, int32 count) // Rewind /*! \brief Rewinds the entry list back to the first entry. - Not implemented for BQuery. + Unlike R5 Haiku implements this method for BQuery. \return - - \c B_ERROR + - \c B_OK on success, + - \c B_FILE_ERROR, if Fetch() has not yet been called. */ status_t BQuery::Rewind() { - return B_ERROR; + if (!_HasFetched()) + return B_FILE_ERROR; + return _kern_rewind_dir(fQueryFd); } // CountEntries