]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
livepatch-tools: fix isnumber() function clash
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 13 Nov 2023 16:09:40 +0000 (17:09 +0100)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 15 Nov 2023 13:34:47 +0000 (13:34 +0000)
isnumber() is already defined for some libcs [0] but the interface is not the
same, the isnumber() helper just checks if a single character is a digit.

Rename isnumber() to is_number() in order to avoid the clash.

[0] https://man.freebsd.org/cgi/man.cgi?query=isnumber&sektion=3

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
create-diff-object.c

index 67784642bcd71915220bc30de17fb98276088d6a..d0e14e3a62bbaed17d554d9f23640a1249d693a0 100644 (file)
@@ -1352,7 +1352,7 @@ static void kpatch_process_special_sections(struct kpatch_elf *kelf)
 }
 
 /* Returns true if s is a string of only numbers with length > 0. */
-static bool isnumber(const char *s)
+static bool is_number(const char *s)
 {
        do {
                if (!*s || !isdigit(*s))
@@ -1380,13 +1380,13 @@ static bool is_rodata_str_section(const char *name)
 
        /* Check if name matches ".rodata.str1.[0-9]+" */
        if (!strncmp(name, GCC_5_SECTION_NAME, strlen(GCC_5_SECTION_NAME)))
-               return isnumber(name + strlen(GCC_5_SECTION_NAME));
+               return is_number(name + strlen(GCC_5_SECTION_NAME));
 
        /* Check if name matches ".rodata.<func>.str1.[0-9]+" */
        s = strstr(name, GCC_6_SECTION_NAME);
        if (!s)
                return false;
-       return isnumber(s + strlen(GCC_6_SECTION_NAME));
+       return is_number(s + strlen(GCC_6_SECTION_NAME));
 #undef GCC_5_SECTION_NAME
 #undef GCC_6_SECTION_NAME
 }