diff mbox series

[2/2] livepatch-tools: fix isnumber() function clash

Message ID 20231113160940.52430-3-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series livepatch-tools: fixes for building on non-glibc | expand

Commit Message

Roger Pau Monne Nov. 13, 2023, 4:09 p.m. UTC
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>
---
 create-diff-object.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/create-diff-object.c b/create-diff-object.c
index 67784642bcd7..d0e14e3a62bb 100644
--- a/create-diff-object.c
+++ b/create-diff-object.c
@@ -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
 }