[PATCH v5 next 04/17] tools/nolibc: Rename the 'errnum' parameter to strerror()

david.laight.linux@gmail.com posted 17 patches 1 month ago
[PATCH v5 next 04/17] tools/nolibc: Rename the 'errnum' parameter to strerror()
Posted by david.laight.linux@gmail.com 1 month ago
From: David Laight <david.laight.linux@gmail.com>

Change the parameter variable name from 'errno' to 'errnum'.
Matches any documentation and avoids any issues that might happen
if errno is actually a #define (which is not uncommon).

Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David Laight <david.laight.linux@gmail.com>
---

Unchanged for v5.

v4:
- split from the previous patch.

 tools/include/nolibc/stdio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h
index af2d5be47aa3..17ca206f77fe 100644
--- a/tools/include/nolibc/stdio.h
+++ b/tools/include/nolibc/stdio.h
@@ -734,7 +734,7 @@ int strerror_r(int errnum, char *buf, size_t buflen)
 }
 
 static __attribute__((unused))
-const char *strerror(int errno)
+const char *strerror(int errnum)
 {
 	static char buf[18];
 	char *b = buf;
@@ -743,7 +743,7 @@ const char *strerror(int errno)
 	_NOLIBC_OPTIMIZER_HIDE_VAR(b);
 
 	/* Use strerror_r() to avoid having the only .data in small programs. */
-	strerror_r(errno, b, sizeof(buf));
+	strerror_r(errnum, b, sizeof(buf));
 
 	return b;
 }
-- 
2.39.5