summaryrefslogtreecommitdiff
path: root/libc/stdlib/realpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/realpath.c')
-rw-r--r--libc/stdlib/realpath.c8
1 files changed, 4 insertions, 4 deletions
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. */