]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: errors: use ring_dup() to duplicate the startup_logs
authorWilly Tarreau <w@1wt.eu>
Tue, 27 Feb 2024 18:52:50 +0000 (19:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2024 17:34:19 +0000 (17:34 +0000)
In startup_logs_dup() we currently need to reference the ring's buffer,
better not do this as it will complicate operations when switching to
other types.

src/errors.c

index c851de31e1658a62118871cd807afb79185d3925..5aeb6a4c28c4e8c927eb177f9c25be4d85549d0a 100644 (file)
@@ -210,8 +210,7 @@ struct ring *startup_logs_dup(struct ring *src)
        if (!dst)
                goto error;
 
-       b_reset(&dst->buf);
-       b_ncat(&dst->buf, &src->buf, ring_data(src));
+       ring_dup(dst, src, ring_size(src));
 error:
        return dst;
 }