diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-04-06 20:28:45 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-04-06 20:28:45 +0000 |
commit | 6278781655261a5011376b2fa2600996e32ca889 (patch) | |
tree | 11783e71b36c8c546c4dc02dff355b0f2478978b /libc/stdlib/realpath.c | |
parent | a704ccaa5232184844cd67315951b39f85a6ba04 (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/realpath.c')
-rw-r--r-- | libc/stdlib/realpath.c | 8 |
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. */ |