ctdb-client: Switch to ETIMEDOUT instead of ETIME
authorAmitay Isaacs <amitay@gmail.com>
Tue, 10 Jul 2018 08:48:53 +0000 (18:48 +1000)
committerMartin Schwenke <martins@samba.org>
Sat, 28 Jul 2018 01:50:10 +0000 (03:50 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/client/client.h
ctdb/client/client_connect.c
ctdb/tests/src/dummy_client.c

index 2eec3eaed63bed75ed38f86e2bf6e77d3bd4f982..d4d145045e070d73fbba78719e48943cddfb493d 100644 (file)
@@ -184,7 +184,7 @@ void ctdb_client_wait(struct tevent_context *ev, bool *done);
  * @param[in] ev Tevent context
  * @param[in] done Boolean flag to indicate when to stop waiting
  * @param[in] timeout How long to wait
- * @return 0 on succes, ETIME on timeout, and errno on failure
+ * @return 0 on succes, ETIMEDOUT on timeout, and errno on failure
  */
 int ctdb_client_wait_timeout(struct tevent_context *ev, bool *done,
                             struct timeval timeout);
index 1e4157e94ffe8a58a38bd8e68ed55ed25ab845d5..0977d7176087a8226f4f2ef5245a02070ca99a07 100644 (file)
@@ -363,7 +363,7 @@ int ctdb_client_wait_timeout(struct tevent_context *ev, bool *done,
        talloc_free(mem_ctx);
 
        if (timed_out) {
-               return ETIME;
+               return ETIMEDOUT;
        }
 
        return 0;
index 6f30512ee65fc5b079bbe700ce30b82cc40a1325..cc6444de968df79e18b7156e8c406c95a0b5a60a 100644 (file)
@@ -155,7 +155,7 @@ int main(int argc, const char *argv[])
 
        ret = ctdb_client_wait_timeout(ev, &done,
                        tevent_timeval_current_ofs(options.timelimit, 0));
-       if (ret != 0 && ret == ETIME) {
+       if (ret != 0 && ret == ETIMEDOUT) {
                D_ERR("client_wait_timeout() failed, ret=%d\n", ret);
                talloc_free(client);
                exit(1);