Wrap open prototype to open.c doesn't go weird
diff --git a/include/fcntl.h b/include/fcntl.h
index c0f2a01..b9336ab 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -13,6 +13,8 @@
/* This is defined here as well as in <unistd.h> since old-style code
would still include <fcntl.h> when using open(), and open() being
a varadic function changes its calling convention on some architectures. */
+#ifndef _KLIBC_IN_OPEN_C
__extern int open(const char *, int, ...);
+#endif
#endif /* _FCNTL_H */
diff --git a/include/unistd.h b/include/unistd.h
index 99341a5..f00c402 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -78,7 +78,9 @@
__extern ssize_t read(int, void *, size_t);
__extern ssize_t write(int, const void *, size_t);
/* Also in <fcntl.h> */
+#ifndef _KLIBC_IN_OPEN_C
__extern int open(const char *, int, ...);
+#endif
__extern int close(int);
__extern off_t lseek(int, off_t, int);
/* off_t is 64 bits now even on 32-bit platforms; see llseek.c */
diff --git a/klibc/include/fcntl.h b/klibc/include/fcntl.h
index c0f2a01..b9336ab 100644
--- a/klibc/include/fcntl.h
+++ b/klibc/include/fcntl.h
@@ -13,6 +13,8 @@
/* This is defined here as well as in <unistd.h> since old-style code
would still include <fcntl.h> when using open(), and open() being
a varadic function changes its calling convention on some architectures. */
+#ifndef _KLIBC_IN_OPEN_C
__extern int open(const char *, int, ...);
+#endif
#endif /* _FCNTL_H */
diff --git a/klibc/include/unistd.h b/klibc/include/unistd.h
index 99341a5..f00c402 100644
--- a/klibc/include/unistd.h
+++ b/klibc/include/unistd.h
@@ -78,7 +78,9 @@
__extern ssize_t read(int, void *, size_t);
__extern ssize_t write(int, const void *, size_t);
/* Also in <fcntl.h> */
+#ifndef _KLIBC_IN_OPEN_C
__extern int open(const char *, int, ...);
+#endif
__extern int close(int);
__extern off_t lseek(int, off_t, int);
/* off_t is 64 bits now even on 32-bit platforms; see llseek.c */
diff --git a/klibc/open.c b/klibc/open.c
index e1d1233..d52b53a 100644
--- a/klibc/open.c
+++ b/klibc/open.c
@@ -5,6 +5,7 @@
* system call, to indicate that we're 64-bit safe.
*/
+#define _KLIBC_IN_OPEN_C
#include <unistd.h>
#include <fcntl.h>
diff --git a/klibc/strerror.c b/klibc/strerror.c
index af13533..bc053db 100644
--- a/klibc/strerror.c
+++ b/klibc/strerror.c
@@ -16,9 +16,9 @@
*--p = '\0';
do {
- *--p = (errnum % 10) + '0';
- errnum /= 10;
- } while ( errnum );
+ *--p = (e % 10) + '0';
+ e /= 10;
+ } while ( e );
memcpy(message+6, p, (numbuf+sizeof numbuf)-p);