From 6278781655261a5011376b2fa2600996e32ca889 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 6 Apr 2001 20:28:45 +0000 Subject: 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 --- libc/stdlib/realpath.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libc/stdlib/realpath.c') 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[]; /* Safely copy the next pathname component. */ while (*path != '\0' && *path != '/') { if (path > max_path) { - errno = ENAMETOOLONG; + __set_errno(ENAMETOOLONG); return NULL; } *new_path++ = *path++; @@ -118,7 +118,7 @@ char resolved_path[]; #ifdef S_IFLNK /* Protect against infinite loops. */ if (readlinks++ > MAX_READLINKS) { - errno = ELOOP; + __set_errno(ELOOP); return NULL; } /* See if latest pathname component is a symlink. */ @@ -143,7 +143,7 @@ char resolved_path[]; while (*(--new_path) != '/'); /* Safe sex check. */ if (strlen(path) + n >= PATH_MAX - 2) { - errno = ENAMETOOLONG; + __set_errno(ENAMETOOLONG); return NULL; } /* Insert symlink contents into path. */ -- cgit v1.2.3