diff options
author | jasone <jasone@FreeBSD.org> | 2000-01-12 09:23:48 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2000-01-12 09:23:48 +0000 |
commit | 75903038bc52105bc7479fe5f2b75f22f10c1c50 (patch) | |
tree | c9e28eda650bbd7eaa3eb22c8d7c75d00a96a451 /lib/libc/gen/fts-compat.c | |
parent | 688bb99b3f790aad607b949661d0361486bbe346 (diff) | |
download | FreeBSD-src-75903038bc52105bc7479fe5f2b75f22f10c1c50.zip FreeBSD-src-75903038bc52105bc7479fe5f2b75f22f10c1c50.tar.gz |
Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep(). The arrows represent weak aliases. For
system calls, the pattern is _read() <-- _libc_read() <-- read().
Diffstat (limited to 'lib/libc/gen/fts-compat.c')
-rw-r--r-- | lib/libc/gen/fts-compat.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index 0ad03ca..bcab9d7 100644 --- a/lib/libc/gen/fts-compat.c +++ b/lib/libc/gen/fts-compat.c @@ -31,6 +31,8 @@ * SUCH DAMAGE. * * $OpenBSD: fts.c,v 1.22 1999/10/03 19:22:22 millert Exp $ + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -176,7 +178,8 @@ fts_open(argv, options, compar) * and ".." are all fairly nasty problems. Note, if we can't get the * descriptor we run anyway, just more slowly. */ - if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0) + if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = _libc_open(".", O_RDONLY, 0)) + < 0) SET(FTS_NOCHDIR); return (sp); @@ -245,7 +248,7 @@ fts_close(sp) /* Return to original directory, save errno if necessary. */ if (!ISSET(FTS_NOCHDIR)) { saved_errno = fchdir(sp->fts_rfd) ? errno : 0; - (void)close(sp->fts_rfd); + (void)_libc_close(sp->fts_rfd); /* Set errno and return. */ if (saved_errno != 0) { @@ -305,7 +308,7 @@ fts_read(sp) (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) { p->fts_info = fts_stat(sp, p, 1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { - if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) { + if ((p->fts_symfd = _libc_open(".", O_RDONLY, 0)) < 0) { p->fts_errno = errno; p->fts_info = FTS_ERR; } else @@ -320,7 +323,7 @@ fts_read(sp) if (instr == FTS_SKIP || (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) { if (p->fts_flags & FTS_SYMFOLLOW) - (void)close(p->fts_symfd); + (void)_libc_close(p->fts_symfd); if (sp->fts_child) { fts_lfree(sp->fts_child); sp->fts_child = NULL; @@ -395,7 +398,7 @@ next: tmp = p; p->fts_info = fts_stat(sp, p, 1); if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) { if ((p->fts_symfd = - open(".", O_RDONLY, 0)) < 0) { + _libc_open(".", O_RDONLY, 0)) < 0) { p->fts_errno = errno; p->fts_info = FTS_ERR; } else @@ -440,12 +443,12 @@ name: t = sp->fts_path + NAPPEND(p->fts_parent); } else if (p->fts_flags & FTS_SYMFOLLOW) { if (FCHDIR(sp, p->fts_symfd)) { saved_errno = errno; - (void)close(p->fts_symfd); + (void)_libc_close(p->fts_symfd); errno = saved_errno; SET(FTS_STOP); return (NULL); } - (void)close(p->fts_symfd); + (void)_libc_close(p->fts_symfd); } else if (!(p->fts_flags & FTS_DONTCHDIR)) { if (CHDIR(sp, "..")) { SET(FTS_STOP); @@ -537,12 +540,12 @@ fts_children(sp, instr) ISSET(FTS_NOCHDIR)) return (sp->fts_child = fts_build(sp, instr)); - if ((fd = open(".", O_RDONLY, 0)) < 0) + if ((fd = _libc_open(".", O_RDONLY, 0)) < 0) return (NULL); sp->fts_child = fts_build(sp, instr); if (fchdir(fd)) return (NULL); - (void)close(fd); + (void)_libc_close(fd); return (sp->fts_child); } @@ -1091,7 +1094,7 @@ fts_safe_changedir(sp, p, fd) newfd = fd; if (ISSET(FTS_NOCHDIR)) return (0); - if (fd < 0 && (newfd = open(p->fts_accpath, O_RDONLY, 0)) < 0) + if (fd < 0 && (newfd = _libc_open(p->fts_accpath, O_RDONLY, 0)) < 0) return (-1); if (fstat(newfd, &sb)) { ret = -1; @@ -1106,7 +1109,7 @@ fts_safe_changedir(sp, p, fd) bail: oerrno = errno; if (fd < 0) - (void)close(newfd); + (void)_libc_close(newfd); errno = oerrno; return (ret); } |