summaryrefslogtreecommitdiff
path: root/libc/stdlib/strto_l.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-06 20:28:45 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-06 20:28:45 +0000
commit6278781655261a5011376b2fa2600996e32ca889 (patch)
tree11783e71b36c8c546c4dc02dff355b0f2478978b /libc/stdlib/strto_l.c
parenta704ccaa5232184844cd67315951b39f85a6ba04 (diff)
Fix include/errno.h to not use kernel header, and instead use bits/errno.h.
This required we use _LIBC instead of __LIBC__ to be consistent with glibc. This had some sideffects in sys/syscalls.h. While fixing things, I made everything use __set_errno() for (eventual) thread support. -Erik
Diffstat (limited to 'libc/stdlib/strto_l.c')
-rw-r--r--libc/stdlib/strto_l.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/stdlib/strto_l.c b/libc/stdlib/strto_l.c
index 16b29f5d6..aed6ef346 100644
--- a/libc/stdlib/strto_l.c
+++ b/libc/stdlib/strto_l.c
@@ -137,7 +137,7 @@ unsigned long _strto_l(const char *str, char **endptr, int base, int uflag)
negative = 0; /* since unsigned returns ULONG_MAX */
}
#if _STRTO_ERRNO
- errno = ERANGE;
+ __set_errno(ERANGE);
#endif
} else {
number = number * base + digit;
@@ -155,7 +155,7 @@ unsigned long _strto_l(const char *str, char **endptr, int base, int uflag)
if (negative) {
if (!uflag && (number > ((unsigned long)(-(1+LONG_MIN)))+1)) {
#if _STRTO_ERRNO
- errno = ERANGE;
+ __set_errno(ERANGE);
#endif
return (unsigned long) LONG_MIN;
}
@@ -163,7 +163,7 @@ unsigned long _strto_l(const char *str, char **endptr, int base, int uflag)
} else {
if (!uflag && (number > (unsigned long) LONG_MAX)) {
#if _STRTO_ERRNO
- errno = ERANGE;
+ __set_errno(ERANGE);
#endif
return LONG_MAX;
}