]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: tools: make resolve_sym_name() take a const pointer
authorWilly Tarreau <w@1wt.eu>
Wed, 20 Jan 2021 13:37:59 +0000 (14:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 20 Jan 2021 16:17:39 +0000 (17:17 +0100)
When 0c439d895 ("BUILD: tools: make resolve_sym_name() return a const")
was written, the pointer argument ought to have been turned to const for
more flexibility. Let's do it now.

include/haproxy/tools.h
src/tools.c

index 651c0701ca7d5937b67b689ea80aa4e3a2e61588..76e6e730c0eaa2710f0b96a144752e1fdd43b081 100644 (file)
@@ -990,7 +990,7 @@ int dump_text_line(struct buffer *out, const char *buf, int bsize, int len,
 void dump_addr_and_bytes(struct buffer *buf, const char *pfx, const void *addr, int n);
 void dump_hex(struct buffer *out, const char *pfx, const void *buf, int len, int unsafe);
 int may_access(const void *ptr);
-const void *resolve_sym_name(struct buffer *buf, const char *pfx, void *addr);
+const void *resolve_sym_name(struct buffer *buf, const char *pfx, const void *addr);
 const char *get_exec_path();
 
 #if defined(USE_BACKTRACE)
index 5895559c79553177a148fa2458524b8df4553024..19b612250ef2e27f0fa3abdb3440158efc76ac00 100644 (file)
@@ -4647,7 +4647,7 @@ static int dladdr_and_size(const void *addr, Dl_info *dli, size_t *size)
  * The symbol's base address is returned, or NULL when unresolved, in order to
  * allow the caller to match it against known ones.
  */
-const void *resolve_sym_name(struct buffer *buf, const char *pfx, void *addr)
+const void *resolve_sym_name(struct buffer *buf, const char *pfx, const void *addr)
 {
        const struct {
                const void *func;