From 3d4dc3e9dbea5e7f7c4eaff810006fee658f7b5e Mon Sep 17 00:00:00 2001 From: alexhudson Date: Sun, 14 Sep 2008 14:40:47 +0000 Subject: [PATCH] Make store watch work on the root collection somewhat. --- src/agents/store/watch.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/agents/store/watch.c b/src/agents/store/watch.c index 294920c..44c309f 100644 --- a/src/agents/store/watch.c +++ b/src/agents/store/watch.c @@ -31,17 +31,17 @@ StoreWatcherFindWatchItem(StoreClient *client, uint64_t collection) WatchItem *to_watch = NULL; for (i = 0; i < MAX_STORE_WATCH; i++) { - WatchItem *item = &global_watch_list[i]; - if ((item->collection == collection) &&(strcmp(item->store, client->storeName)==0)) { - // found the watch item for this collection in the right store - to_watch = item; - } - if ((to_watch == NULL) && (item->store == NULL)) { - // found the first free entry (overridden by above) - to_watch = item; - } - } - return to_watch; + WatchItem *item = &global_watch_list[i]; + if ((item->collection == collection) && (item->store != NULL) && (strcmp(item->store, client->storeName)==0)) { + // found the watch item for this collection in the right store + to_watch = item; + } + if ((to_watch == NULL) && (item->store == NULL)) { + // found the first free entry (overridden by above) + to_watch = item; + } + } + return to_watch; } /** \internal