From 2edf7c468768196178cdd07aae92b50c0a026a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 20 Oct 2009 21:03:11 +0000 Subject: [PATCH] * I just checked, and BeOS actually does not update the query this way - this must have been my very own stupid idea. It's removed now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33685 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Query.cpp | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Query.cpp b/src/add-ons/kernel/file_systems/bfs/Query.cpp index eaa10135b9..a6d3229b4a 100644 --- a/src/add-ons/kernel/file_systems/bfs/Query.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Query.cpp @@ -1620,7 +1620,6 @@ Query::LiveUpdate(Inode* inode, const char* attribute, int32 type, status_t newStatus = fExpression->Root()->Match(inode, attribute, type, newKey, newLength); - const char* name = NULL; bool entryCreated; if (oldStatus != MATCH_OK) { @@ -1633,31 +1632,22 @@ Query::LiveUpdate(Inode* inode, const char* attribute, int32 type, // entry got removed entryCreated = false; } else { - // The entry stays in the query - only notify in case the name of the - // inode was changed - if (oldKey == NULL || strcmp(attribute, "name") != 0 || newKey == NULL) - return; - - notify_query_entry_removed(fPort, fToken, fVolume->ID(), - fVolume->ToVnode(inode->Parent()), (const char*)oldKey, - inode->ID()); - name = (const char*)newKey; - entryCreated = true; + // The entry stays in the query + return; } // we may need to get the name of the inode char nameBuffer[B_FILE_NAME_LENGTH]; + const char* name; - if (name == NULL) { - if (strcmp(attribute, "name")) { - if (inode->GetName(nameBuffer) != B_OK) - nameBuffer[0] = '\0'; - name = nameBuffer; - } else { - // a shortcut to prevent having to scan the attribute section - name = (const char*)newKey; - } + if (strcmp(attribute, "name")) { + if (inode->GetName(nameBuffer) != B_OK) + nameBuffer[0] = '\0'; + name = nameBuffer; + } else { + // a shortcut to prevent having to scan the attribute section + name = (const char*)newKey; } // notify query listeners