From: Sage Weil Date: Sun, 14 Dec 2014 05:40:21 +0000 (-0800) Subject: ceph_test_stress_watch: do not unwatch if watch failed X-Git-Tag: v0.91~57 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a2572c38f1eb97ee47d848ee7db8d0f33791271c;p=ceph.git ceph_test_stress_watch: do not unwatch if watch failed Signed-off-by: Sage Weil --- diff --git a/src/test/test_stress_watch.cc b/src/test/test_stress_watch.cc index c9813e698f54a..168714bba28ac 100644 --- a/src/test/test_stress_watch.cc +++ b/src/test/test_stress_watch.cc @@ -51,9 +51,10 @@ struct WatcherUnwatcher : public Thread { uint64_t handle; WatchNotifyTestCtx watch_ctx; - ioctx.watch("foo", 0, &handle, &watch_ctx); + int r = ioctx.watch("foo", 0, &handle, &watch_ctx); bufferlist bl; - ioctx.unwatch("foo", handle); + if (r == 0) + ioctx.unwatch("foo", handle); ioctx.close(); } return NULL;