]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/defer.c: replaced ETIME with ETIMEDOUT for timeout errors
authorAleš Mrázek <ales.mrazek@nic.cz>
Mon, 24 Nov 2025 19:12:32 +0000 (20:12 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Thu, 27 Nov 2025 11:15:28 +0000 (12:15 +0100)
ETIMEDOUT explicitly indicates a timeout condition defined by POSIX and improves portability.

daemon/defer.c

index 5d0c2a43f113ffab9a619eb1917dbcb64a7a5d0a..cffb53991be1c5dcc9904f49ec99a7348c3d2380 100644 (file)
@@ -461,7 +461,7 @@ static inline void process_single_deferred(void)
                        }
                }
 
-               break_query(ctx, ETIME);
+               break_query(ctx, ETIMEDOUT);
                return;
        }
 
@@ -528,7 +528,7 @@ static inline void cleanup_queues(void)
                        uint64_t age_ns = defer_sample_state.stamp - idata->req_stamp;
                        if (age_ns < REQ_TIMEOUT) break;
                        pop_query_queue(i);
-                       break_query(ctx, ETIME);
+                       break_query(ctx, ETIMEDOUT);
                        cnt++;
                }
                if (cnt > 0) {