]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: coroutine set_state() also sets retcode
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 26 Jul 2018 00:49:43 +0000 (17:49 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 11 Dec 2018 08:10:43 +0000 (00:10 -0800)
Generally recode is needed for the caller, but current might need it too.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_coroutine.h

index 6055eb3b70f9c1b00012718076593d77f9fe0244..e8173b3f01671c88cf7d226b82f7e84aac4fb5d8 100644 (file)
@@ -228,16 +228,15 @@ protected:
   stringstream error_stream;
 
   int set_state(int s, int ret = 0) {
+    retcode = ret;
     state = s;
     return ret;
   }
   int set_cr_error(int ret) {
-    state = RGWCoroutine_Error;
-    return ret;
+    return set_state(RGWCoroutine_Error, ret);
   }
   int set_cr_done() {
-    state = RGWCoroutine_Done;
-    return 0;
+    return set_state(RGWCoroutine_Done, 0);
   }
   void set_io_blocked(bool flag);