]> granicus.if.org Git - strace/commitdiff
Identifier "errno" may be a macro, it's unsafe to use it
authorDenys Vlasenko <dvlasenk@redhat.com>
Wed, 25 May 2011 13:33:26 +0000 (15:33 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Wed, 25 May 2011 13:33:26 +0000 (15:33 +0200)
* strace.c (strerror): Rename parameter errno to err_no

strace.c

index 61176b674111a1494834857083fda7dac5c2ac51..d83cbf63cfaf233b565efdee0755a7114c6b90b5 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -1955,16 +1955,16 @@ extern char *sys_errlist[];
 #endif /* HAVE_DECL_SYS_ERRLIST */
 
 const char *
-strerror(errno)
-int errno;
+strerror(err_no)
+int err_no;
 {
        static char buf[64];
 
-       if (errno < 1 || errno >= sys_nerr) {
-               sprintf(buf, "Unknown error %d", errno);
+       if (err_no < 1 || err_no >= sys_nerr) {
+               sprintf(buf, "Unknown error %d", err_no);
                return buf;
        }
-       return sys_errlist[errno];
+       return sys_errlist[err_no];
 }
 
 #endif /* HAVE_STERRROR */