summaryrefslogtreecommitdiff
path: root/libc
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
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')
-rw-r--r--libc/inet/hostid.c2
-rw-r--r--libc/inet/rpc/bindresvport.c4
-rw-r--r--libc/misc/dirent/closedir.c4
-rw-r--r--libc/misc/dirent/dirfd.c2
-rw-r--r--libc/misc/dirent/opendir.c6
-rw-r--r--libc/misc/dirent/readdir.c6
-rw-r--r--libc/misc/dirent/rewinddir.c2
-rw-r--r--libc/misc/dirent/seekdir.c2
-rw-r--r--libc/misc/dirent/telldir.c4
-rw-r--r--libc/misc/internals/__uClibc_main.c2
-rw-r--r--libc/misc/lock/flock.c2
-rw-r--r--libc/misc/regex/regex.c3
-rw-r--r--libc/misc/syslog/syslog.c2
-rw-r--r--libc/misc/time/adjtime.c2
-rw-r--r--libc/pwd_grp/fgetgrent.c2
-rw-r--r--libc/pwd_grp/fgetpwent.c2
-rw-r--r--libc/pwd_grp/getgrnam.c2
-rw-r--r--libc/pwd_grp/getpw.c4
-rw-r--r--libc/pwd_grp/getpwnam.c2
-rw-r--r--libc/pwd_grp/putpwent.c2
-rw-r--r--libc/signal/sigaddset.c2
-rw-r--r--libc/signal/sigdelset.c2
-rw-r--r--libc/signal/sigemptyset.c2
-rw-r--r--libc/signal/sigfillset.c2
-rw-r--r--libc/signal/sigismem.c2
-rw-r--r--libc/stdio/getdelim.c6
-rw-r--r--libc/stdio/popen.c2
-rw-r--r--libc/stdio/remove.c2
-rw-r--r--libc/stdio/stdio.c14
-rw-r--r--libc/stdlib/atexit.c2
-rw-r--r--libc/stdlib/mkstemp.c4
-rw-r--r--libc/stdlib/mktemp.c4
-rw-r--r--libc/stdlib/realpath.c8
-rw-r--r--libc/stdlib/setenv.c2
-rw-r--r--libc/stdlib/strto_l.c6
-rw-r--r--libc/stdlib/strto_ll.c6
-rw-r--r--libc/stdlib/strtod.c2
-rw-r--r--libc/string/config.c4
-rw-r--r--libc/sysdeps/linux/arm/bits/errno.h60
-rw-r--r--libc/sysdeps/linux/common/create_module.c2
-rw-r--r--libc/sysdeps/linux/common/errno.c1
-rw-r--r--libc/sysdeps/linux/common/getdnnm.c4
-rw-r--r--libc/sysdeps/linux/common/gethstnm.c4
-rw-r--r--libc/sysdeps/linux/common/seteuid.c2
-rw-r--r--libc/sysdeps/linux/common/syscalls.c2
-rw-r--r--libc/sysdeps/linux/i386/__init_brk.c6
-rw-r--r--libc/sysdeps/linux/i386/brk.c6
-rw-r--r--libc/sysdeps/linux/i386/sbrk.c6
-rw-r--r--libc/sysdeps/linux/m68k/ptrace.c4
-rw-r--r--libc/termios/tcgetsid.c4
-rw-r--r--libc/termios/tcsetattr.c6
-rw-r--r--libc/termios/termios.c6
-rw-r--r--libc/termios/ttyname.c6
-rw-r--r--libc/unistd/getcwd.c10
-rw-r--r--libc/unistd/sysconf.c8
55 files changed, 165 insertions, 101 deletions
diff --git a/libc/inet/hostid.c b/libc/inet/hostid.c
index 84a441acf..0873aa4fc 100644
--- a/libc/inet/hostid.c
+++ b/libc/inet/hostid.c
@@ -17,7 +17,7 @@ int sethostid(long int new_id)
int fd;
int ret;
- if (geteuid() || getuid()) return errno=EPERM;
+ if (geteuid() || getuid()) return __set_errno(EPERM);
if ((fd=open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1;
ret = write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id)
? 0 : -1;
diff --git a/libc/inet/rpc/bindresvport.c b/libc/inet/rpc/bindresvport.c
index ad8678416..e71dff7f4 100644
--- a/libc/inet/rpc/bindresvport.c
+++ b/libc/inet/rpc/bindresvport.c
@@ -62,14 +62,14 @@ struct sockaddr_in *sin;
bzero(sin, sizeof(*sin));
sin->sin_family = AF_INET;
} else if (sin->sin_family != AF_INET) {
- errno = EPFNOSUPPORT;
+ __set_errno(EPFNOSUPPORT);
return (-1);
}
if (port == 0) {
port = (getpid() % NPORTS) + STARTPORT;
}
res = -1;
- errno = EADDRINUSE;
+ __set_errno(EADDRINUSE);
for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; i++) {
sin->sin_port = htons(port++);
if (port > ENDPORT) {
diff --git a/libc/misc/dirent/closedir.c b/libc/misc/dirent/closedir.c
index f2ead00f2..a2ac83b17 100644
--- a/libc/misc/dirent/closedir.c
+++ b/libc/misc/dirent/closedir.c
@@ -9,13 +9,13 @@ int closedir(DIR * dir)
int fd;
if (!dir) {
- errno = EBADF;
+ __set_errno(EBADF);
return -1;
}
/* We need to check dd_fd. */
if (dir->dd_fd == -1) {
- errno = EBADF;
+ __set_errno(EBADF);
return -1;
}
fd = dir->dd_fd;
diff --git a/libc/misc/dirent/dirfd.c b/libc/misc/dirent/dirfd.c
index d401dccd2..d6c1e6647 100644
--- a/libc/misc/dirent/dirfd.c
+++ b/libc/misc/dirent/dirfd.c
@@ -4,7 +4,7 @@
int dirfd(DIR * dir)
{
if (!dir || dir->dd_fd == -1) {
- errno = EBADF;
+ __set_errno(EBADF);
return -1;
}
diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c
index 329515447..0ac1637b3 100644
--- a/libc/misc/dirent/opendir.c
+++ b/libc/misc/dirent/opendir.c
@@ -21,7 +21,7 @@ DIR *opendir(const char *name)
if (stat(name, &statbuf))
return NULL;
if (!S_ISDIR(statbuf.st_mode)) {
- errno = ENOTDIR;
+ __set_errno(ENOTDIR);
return NULL;
}
if ((fd = open(name, O_RDONLY)) < 0)
@@ -33,7 +33,7 @@ DIR *opendir(const char *name)
return NULL;
if (!(ptr = malloc(sizeof(*ptr)))) {
close(fd);
- errno = ENOMEM;
+ __set_errno(ENOMEM);
return NULL;
}
@@ -44,7 +44,7 @@ DIR *opendir(const char *name)
if (!(buf = malloc(ptr->dd_max))) {
close(fd);
free(ptr);
- errno = ENOMEM;
+ __set_errno(ENOMEM);
return NULL;
}
ptr->dd_fd = fd;
diff --git a/libc/misc/dirent/readdir.c b/libc/misc/dirent/readdir.c
index a755ed24d..0bb03f4c2 100644
--- a/libc/misc/dirent/readdir.c
+++ b/libc/misc/dirent/readdir.c
@@ -14,7 +14,7 @@ struct dirent *readdir(DIR * dir)
struct dirent *de;
if (!dir) {
- errno = EBADF;
+ __set_errno(EBADF);
return NULL;
}
@@ -37,7 +37,7 @@ struct dirent *readdir(DIR * dir)
dir->dd_getdents = no_getdents;
abort();
}
- errno = result;
+ __set_errno(result);
}
return NULL;
@@ -63,7 +63,7 @@ struct dirent *readdir(DIR * dir)
if (strlen((char *) &de->d_type) > 10)
de->d_name[10] = 0;
strcpy(dir->dd_buf->d_name, (char *) &de->d_name);
- errno = 0;
+ __set_errno(0);
return dir->dd_buf;
}
diff --git a/libc/misc/dirent/rewinddir.c b/libc/misc/dirent/rewinddir.c
index 9d147fca2..2fff9101c 100644
--- a/libc/misc/dirent/rewinddir.c
+++ b/libc/misc/dirent/rewinddir.c
@@ -7,7 +7,7 @@
void rewinddir(DIR * dir)
{
if (!dir) {
- errno = EBADF;
+ __set_errno(EBADF);
return;
}
lseek(dir->dd_fd, 0, SEEK_SET);
diff --git a/libc/misc/dirent/seekdir.c b/libc/misc/dirent/seekdir.c
index 7e4f24f72..3ff9f5da9 100644
--- a/libc/misc/dirent/seekdir.c
+++ b/libc/misc/dirent/seekdir.c
@@ -6,7 +6,7 @@
void seekdir(DIR * dir, off_t offset)
{
if (!dir) {
- errno = EBADF;
+ __set_errno(EBADF);
return;
}
dir->dd_nextoff = lseek(dir->dd_fd, offset, SEEK_SET);
diff --git a/libc/misc/dirent/telldir.c b/libc/misc/dirent/telldir.c
index 33e163aba..872cddbf1 100644
--- a/libc/misc/dirent/telldir.c
+++ b/libc/misc/dirent/telldir.c
@@ -8,7 +8,7 @@ off_t telldir(DIR * dir)
off_t offset;
if (!dir) {
- errno = EBADF;
+ __set_errno(EBADF);
return -1;
}
@@ -27,7 +27,7 @@ off_t telldir(DIR * dir)
break;
default:
- errno = EBADF;
+ __set_errno(EBADF);
offset = -1;
}
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 23ca473ee..26c028015 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -64,7 +64,7 @@ void __uClibc_main(int argc, char **argv, char **envp)
* have resulted in errno being set nonzero, so set it to 0 before
* we call main.
*/
- errno = 0;
+ __set_errno(0);
/*
* Finally, invoke application's main and then exit.
diff --git a/libc/misc/lock/flock.c b/libc/misc/lock/flock.c
index 3c1264655..80d15dfd4 100644
--- a/libc/misc/lock/flock.c
+++ b/libc/misc/lock/flock.c
@@ -42,7 +42,7 @@ int flock( int fd, int operation)
lbuf.l_type = F_UNLCK;
break;
default:
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c
index 64e754ee0..19e3e0cbb 100644
--- a/libc/misc/regex/regex.c
+++ b/libc/misc/regex/regex.c
@@ -19,6 +19,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* To exclude some unwanted junk.... */
+#undef _LIBC
+
/* AIX requires this to be the first thing in the file. */
#if defined _AIX && !defined REGEX_MALLOC
#pragma alloca
diff --git a/libc/misc/syslog/syslog.c b/libc/misc/syslog/syslog.c
index 53a00f86d..b3c53ff7d 100644
--- a/libc/misc/syslog/syslog.c
+++ b/libc/misc/syslog/syslog.c
@@ -224,7 +224,7 @@ vsyslog( int pri, const char *fmt, va_list ap )
*/
end = tbuf + sizeof(tbuf) - 1;
- errno = saved_errno;
+ __set_errno(saved_errno);
p += vsnprintf(p, end - p, fmt, ap);
if (p >= end || p < head_end) { /* Returned -1 in case of error... */
static char truncate_msg[12] = "[truncated] ";
diff --git a/libc/misc/time/adjtime.c b/libc/misc/time/adjtime.c
index 12c1a2a40..2a9190e9b 100644
--- a/libc/misc/time/adjtime.c
+++ b/libc/misc/time/adjtime.c
@@ -24,7 +24,7 @@ adjtime(const struct timeval * itv, struct timeval * otv)
tmp.tv_usec = itv->tv_usec % 1000000L;
if (tmp.tv_sec > MAX_SEC || tmp.tv_sec < MIN_SEC)
{
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
tntx.offset = tmp.tv_usec + tmp.tv_sec * 1000000L;
diff --git a/libc/pwd_grp/fgetgrent.c b/libc/pwd_grp/fgetgrent.c
index 09701a38b..50aa01722 100644
--- a/libc/pwd_grp/fgetgrent.c
+++ b/libc/pwd_grp/fgetgrent.c
@@ -25,7 +25,7 @@
struct group *fgetgrent(FILE * file)
{
if (file == NULL) {
- errno = EINTR;
+ __set_errno(EINTR);
return NULL;
}
diff --git a/libc/pwd_grp/fgetpwent.c b/libc/pwd_grp/fgetpwent.c
index 74c59427c..aab1ec744 100644
--- a/libc/pwd_grp/fgetpwent.c
+++ b/libc/pwd_grp/fgetpwent.c
@@ -32,7 +32,7 @@ int fgetpwent_r (FILE *file, struct passwd *password,
char *buff, size_t buflen, struct passwd **crap)
{
if (file == NULL) {
- errno = EINTR;
+ __set_errno(EINTR);
return -1;
}
return(__getpwent_r(password, buff, buflen, fileno(file)));
diff --git a/libc/pwd_grp/getgrnam.c b/libc/pwd_grp/getgrnam.c
index 999404284..6f2634cee 100644
--- a/libc/pwd_grp/getgrnam.c
+++ b/libc/pwd_grp/getgrnam.c
@@ -30,7 +30,7 @@ struct group *getgrnam(const char *name)
struct group *group;
if (name == NULL) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return NULL;
}
diff --git a/libc/pwd_grp/getpw.c b/libc/pwd_grp/getpw.c
index f0663c917..83f6fe973 100644
--- a/libc/pwd_grp/getpw.c
+++ b/libc/pwd_grp/getpw.c
@@ -28,7 +28,7 @@ int getpw(uid_t uid, char *buf)
struct passwd *passwd;
if (buf == NULL) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
if ((passwd = getpwuid(uid)) == NULL)
@@ -38,7 +38,7 @@ int getpw(uid_t uid, char *buf)
(buf, "%s:%s:%u:%u:%s:%s:%s", passwd->pw_name, passwd->pw_passwd,
passwd->pw_gid, passwd->pw_uid, passwd->pw_gecos, passwd->pw_dir,
passwd->pw_shell) < 0) {
- errno = ENOBUFS;
+ __set_errno(ENOBUFS);
return -1;
}
diff --git a/libc/pwd_grp/getpwnam.c b/libc/pwd_grp/getpwnam.c
index 399e24ddc..5cb4f64f8 100644
--- a/libc/pwd_grp/getpwnam.c
+++ b/libc/pwd_grp/getpwnam.c
@@ -38,7 +38,7 @@ int getpwnam_r (const char *name, struct passwd *password,
int passwd_fd;
if (name == NULL) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
diff --git a/libc/pwd_grp/putpwent.c b/libc/pwd_grp/putpwent.c
index da8e13d67..014cefa86 100644
--- a/libc/pwd_grp/putpwent.c
+++ b/libc/pwd_grp/putpwent.c
@@ -25,7 +25,7 @@
int putpwent(const struct passwd *passwd, FILE * f)
{
if (passwd == NULL || f == NULL) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
if (fprintf
diff --git a/libc/signal/sigaddset.c b/libc/signal/sigaddset.c
index ec1c96e9b..269f7d367 100644
--- a/libc/signal/sigaddset.c
+++ b/libc/signal/sigaddset.c
@@ -25,7 +25,7 @@
int sigaddset ( sigset_t *set, int signo)
{
if (set == NULL || signo <= 0 || signo >= NSIG) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
diff --git a/libc/signal/sigdelset.c b/libc/signal/sigdelset.c
index daa545624..958f1d44a 100644
--- a/libc/signal/sigdelset.c
+++ b/libc/signal/sigdelset.c
@@ -23,7 +23,7 @@
int sigdelset ( sigset_t *set, int signo)
{
if (set == NULL || signo <= 0 || signo >= NSIG) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
diff --git a/libc/signal/sigemptyset.c b/libc/signal/sigemptyset.c
index c38cb0e5a..19d8dabdf 100644
--- a/libc/signal/sigemptyset.c
+++ b/libc/signal/sigemptyset.c
@@ -25,7 +25,7 @@ int
sigemptyset ( sigset_t *set)
{
if (set == NULL) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
diff --git a/libc/signal/sigfillset.c b/libc/signal/sigfillset.c
index 1d67f1dc5..c3ebcce4b 100644
--- a/libc/signal/sigfillset.c
+++ b/libc/signal/sigfillset.c
@@ -27,7 +27,7 @@ sigfillset (set)
{
if (set == NULL)
{
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
diff --git a/libc/signal/sigismem.c b/libc/signal/sigismem.c
index 3e9b67c6c..64b14f37e 100644
--- a/libc/signal/sigismem.c
+++ b/libc/signal/sigismem.c
@@ -25,7 +25,7 @@
int sigismember ( const sigset_t *set, int signo)
{
if (set == NULL || signo <= 0 || signo >= NSIG) {
- errno=EINVAL;
+ __set_errno(EINVAL);
return -1;
}
diff --git a/libc/stdio/getdelim.c b/libc/stdio/getdelim.c
index 6f9ebb4fb..9181f9aa0 100644
--- a/libc/stdio/getdelim.c
+++ b/libc/stdio/getdelim.c
@@ -43,14 +43,14 @@ ssize_t getdelim(char **linebuf, size_t *linebufsz, int delimiter, FILE *file)
if ((file == NULL || linebuf==NULL || *linebuf == NULL || *linebufsz == 0)
&& !(*linebuf == NULL && *linebufsz ==0 )) {
- errno=EINVAL;
+ __set_errno(EINVAL);
return -1;
}
if (*linebuf == NULL && *linebufsz == 0){
*linebuf = malloc(GROWBY);
if (!*linebuf) {
- errno=ENOMEM;
+ __set_errno(ENOMEM);
return -1;
}
*linebufsz += GROWBY;
@@ -64,7 +64,7 @@ ssize_t getdelim(char **linebuf, size_t *linebufsz, int delimiter, FILE *file)
while (idx > *linebufsz-2) {
*linebuf = realloc(*linebuf, *linebufsz += GROWBY);
if (!*linebuf) {
- errno=ENOMEM;
+ __set_errno(ENOMEM);
return -1;
}
}
diff --git a/libc/stdio/popen.c b/libc/stdio/popen.c
index bc91bb73b..0a91f0e22 100644
--- a/libc/stdio/popen.c
+++ b/libc/stdio/popen.c
@@ -21,7 +21,7 @@ FILE *popen (const char *command, const char *mode)
reading = (mode[0] == 'r');
if ((!reading && (mode[0] != 'w')) || mode[1]) {
- errno = EINVAL; /* Invalid mode arg. */
+ __set_errno(EINVAL); /* Invalid mode arg. */
} else if (pipe(pipe_fd) == 0) {
pr = pipe_fd[reading];
pnr = pipe_fd[1-reading];
diff --git a/libc/stdio/remove.c b/libc/stdio/remove.c
index 115b871bb..af256e4aa 100644
--- a/libc/stdio/remove.c
+++ b/libc/stdio/remove.c
@@ -17,7 +17,7 @@ __const char *src;
if (rv < 0 && errno == EISDIR)
rv = rmdir(src);
if (rv >= 0)
- errno = er;
+ __set_errno(er);
return rv;
}
diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c
index fe1c6a073..954318d39 100644
--- a/libc/stdio/stdio.c
+++ b/libc/stdio/stdio.c
@@ -279,7 +279,7 @@ int fflush(FILE *fp)
* ANSI says behavior in this case is undefined but also says you
* shouldn't flush a stream you were reading from.
*/
- errno = EBADF; /* Should we set stream error indicator? */
+ __set_errno(EBADF); /* Should we set stream error indicator? */
rv = -1;
}
@@ -560,7 +560,7 @@ int fseek(FILE *fp, long int offset, int ref)
#endif
if ((ref < 0) || (ref > 2)) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
@@ -610,7 +610,7 @@ FILE *fp;
--pos;
}
if (pos < 0) { /* ungetcs at start of file? */
- errno = EIO;
+ __set_errno(EIO);
pos = -1;
}
}
@@ -666,7 +666,7 @@ const char *mode;
open_mode = (O_WRONLY | O_CREAT | O_APPEND);
break;
default: /* illegal mode */
- errno = EINVAL;
+ __set_errno(EINVAL);
goto _fopen_ERROR;
}
@@ -709,7 +709,7 @@ const char *mode;
fd = -1;
} else if (!(cur_mode & O_RDWR)
&& ((cur_mode ^ open_mode) & O_ACCMODE)) {
- errno = EINVAL;
+ __set_errno(EINVAL);
fd = -1;
}
}
@@ -1037,7 +1037,7 @@ int fgetpos(FILE *fp, fpos_t *pos)
fpos_t p;
if (!pos) { /* NULL pointer. */
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
@@ -1056,7 +1056,7 @@ int fsetpos(FILE *fp, __const fpos_t *pos)
if (pos) { /* Pointer ok. */
return fseek(fp, *pos, SEEK_SET);
}
- errno = EINVAL; /* NULL pointer. */
+ __set_errno(EINVAL); /* NULL pointer. */
return EOF;
}
#endif
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c
index b18e7951d..1ff8d9004 100644
--- a/libc/stdlib/atexit.c
+++ b/libc/stdlib/atexit.c
@@ -51,7 +51,7 @@ static void atexit_handler(void)
int atexit(vfuncp ptr)
{
if ((__uClibc_cleanup == 0) || (__atexit_count >= __UCLIBC_MAX_ATEXIT)) {
- errno = ENOMEM;
+ __set_errno(ENOMEM);
return -1;
}
if (ptr) {
diff --git a/libc/stdlib/mkstemp.c b/libc/stdlib/mkstemp.c
index 551f03199..241f8af8a 100644
--- a/libc/stdlib/mkstemp.c
+++ b/libc/stdlib/mkstemp.c
@@ -13,13 +13,13 @@ char *template;
int l = strlen(template);
if (l < 6) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
for (i = l - 6; i < l; i++)
if (template[i] != 'X') {
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
diff --git a/libc/stdlib/mktemp.c b/libc/stdlib/mktemp.c
index 4b9f71d47..9d65d0441 100644
--- a/libc/stdlib/mktemp.c
+++ b/libc/stdlib/mktemp.c
@@ -15,13 +15,13 @@ char *template;
struct stat stbuf;
if (l < 6) {
- errno = EINVAL;
+ __set_errno(EINVAL);
return 0;
}
for (i = l - 6; i < l; i++)
if (template[i] != 'X') {
- errno = EINVAL;
+ __set_errno(EINVAL);
return 0;
}
diff --git a/libc/stdlib/realpath.c b/libc/stdlib/realpath.c
index 73903371f..c3628b745 100644
--- a/libc/stdlib/realpath.c
+++ b/libc/stdlib/realpath.c
@@ -60,7 +60,7 @@ char resolved_path[];
/* Make a copy of the source path since we may need to modify it. */
if (strlen(path) >= PATH_MAX - 2) {
- errno = ENAMETOOLONG;
+ __set_errno(ENAMETOOLONG);
return NULL;
}
strcpy(copy_path, path);
@@ -110,7 +110,7 @@ char resolved_path[];