]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
net: fix timeout decreasing (Coverity)
authorDaniel Salzman <daniel.salzman@nic.cz>
Wed, 24 Jul 2019 09:29:39 +0000 (11:29 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 24 Jul 2019 09:31:07 +0000 (11:31 +0200)
src/contrib/net.c

index b757873f630ac89382f7c67b3a77f1bd61871523..3fe0af6710d1ab1c203b915b8985097af3f4f56f 100644 (file)
@@ -395,7 +395,7 @@ static void msg_iov_shift(struct msghdr *msg, size_t done)
 #define TIMEOUT_CTX_UPDATE \
        if (*timeout_ptr > 0) { \
                clock_gettime(CLOCK_MONOTONIC, &end); \
-               int running_ms = time_diff_ms(&end, &begin); \
+               int running_ms = time_diff_ms(&begin, &end); \
                *timeout_ptr = MAX(*timeout_ptr - running_ms, 0); \
        }