summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/atoll.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/atoll.c')
-rw-r--r--lib/libc/stdlib/atoll.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libc/stdlib/atoll.c b/lib/libc/stdlib/atoll.c
index 72ca59a..c0a7212 100644
--- a/lib/libc/stdlib/atoll.c
+++ b/lib/libc/stdlib/atoll.c
@@ -33,12 +33,18 @@
* $FreeBSD$
*/
-#include <stddef.h>
+#include <errno.h>
#include <stdlib.h>
long long
atoll(str)
const char *str;
{
- return(strtoll(str, (char **)NULL, 10));
+ long long r;
+ int saverr;
+
+ saverr = errno;
+ r = strtoll(str, (char **)NULL, 10);
+ errno = saverr;
+ return r;
}
OpenPOWER on IntegriCloud