Adapted because of the changes made to _kern_open_query().

Implemented BQuery::Rewind() - there is no reason not to do this, as the
kernel has no extra work because of this.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10400 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-12-12 20:41:10 +00:00
parent f6743bd145
commit 4d875b0525

View File

@ -1,6 +1,6 @@
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered // This software is part of the Haiku distribution and is covered
// by the OpenBeOS license. // by the MIT license.
//--------------------------------------------------------------------- //---------------------------------------------------------------------
/*! /*!
\file Query.cpp \file Query.cpp
@ -516,16 +516,17 @@ BQuery::Fetch()
{ {
if (_HasFetched()) if (_HasFetched())
return B_NOT_ALLOWED; return B_NOT_ALLOWED;
_EvaluateStack(); _EvaluateStack();
if (!fPredicate || fDevice < 0) if (!fPredicate || fDevice < 0)
return B_NO_INIT; return B_NO_INIT;
if (fLive) {
fQueryFd = _kern_open_query(fDevice, fPredicate, B_LIVE_QUERY, fQueryFd = _kern_open_query(fDevice, fPredicate, strlen(fPredicate),
fPort, fToken); fLive ? B_LIVE_QUERY : 0, fPort, fToken);
} else
fQueryFd = _kern_open_query(fDevice, fPredicate, 0, -1, -1);
if (fQueryFd < 0) if (fQueryFd < 0)
return fQueryFd; return fQueryFd;
return B_OK; return B_OK;
} }
@ -627,13 +628,15 @@ BQuery::GetNextDirents(struct dirent *buf, size_t length, int32 count)
} }
// Rewind // Rewind
/*! \brief Unimplemented method of the BEntryList interface. /*! \brief Rewinds the entry list back to the first entry.
\return \c B_ERROR. \return
- \c B_OK on success,
- \c B_FILE_ERROR if Fetch() has not yet been called
*/ */
status_t status_t
BQuery::Rewind() BQuery::Rewind()
{ {
return B_ERROR; return _kern_rewind_dir(fQueryFd);
} }
// CountEntries // CountEntries