summaryrefslogtreecommitdiffstats
path: root/libc/stdio/popen.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-12-02 01:50:58 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-12-02 01:50:58 +0000
commit6fd3ac79613c9e1832513b0f614860be2735993f (patch)
tree5f6bfb750aed249d5951d84de663c03f9e4b82dd /libc/stdio/popen.c
parent9acef89e60381a298801e4b221d66b1538072b28 (diff)
downloaduClibc-alpine-6fd3ac79613c9e1832513b0f614860be2735993f.tar.bz2
uClibc-alpine-6fd3ac79613c9e1832513b0f614860be2735993f.tar.xz
Merge from trunk.
Diffstat (limited to 'libc/stdio/popen.c')
-rw-r--r--libc/stdio/popen.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libc/stdio/popen.c b/libc/stdio/popen.c
index c7887ad41..6de09253c 100644
--- a/libc/stdio/popen.c
+++ b/libc/stdio/popen.c
@@ -84,23 +84,23 @@ FILE *popen(const char *command, const char *modes)
parent_fd = pipe_fd[1-child_writing];
if (!(fp = fdopen(parent_fd, modes))) {
- close(parent_fd);
- close(child_fd);
+ __close(parent_fd);
+ __close(child_fd);
goto FREE_PI;
}
VFORK_LOCK;
if ((pid = vfork()) == 0) { /* Child of vfork... */
- close(parent_fd);
+ __close(parent_fd);
if (child_fd != child_writing) {
dup2(child_fd, child_writing);
- close(child_fd);
+ __close(child_fd);
}
/* SUSv3 requires that any previously popen()'d streams in the
* parent shall be closed in the child. */
for (po = popen_list ; po ; po = po->next) {
- close(po->f->__filedes);
+ __close(po->f->__filedes);
}
execl("/bin/sh", "sh", "-c", command, (char *)0);
@@ -113,7 +113,7 @@ FILE *popen(const char *command, const char *modes)
/* We need to close the child filedes whether vfork failed or
* it succeeded and we're in the parent. */
- close(child_fd);
+ __close(child_fd);
if (pid > 0) { /* Parent of vfork... */
pi->pid = pid;