summaryrefslogtreecommitdiff
path: root/libc/stdio/popen.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-11-15 21:12:09 +0000
committerEric Andersen <andersen@codepoet.org>2000-11-15 21:12:09 +0000
commitafa40ade775710f3a449e10778159ade4c133d45 (patch)
treedfcfb8d70f95e89273ee32d14c982c529c08a676 /libc/stdio/popen.c
parentdc7f2e1bf0dc6ab6bec1d531026fb39271287711 (diff)
Add in tmpnam() support from David Whedon <dwhedon@gordian.com>,
rework include/stdio.h, and fix up the resultant damage.
Diffstat (limited to 'libc/stdio/popen.c')
-rw-r--r--libc/stdio/popen.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libc/stdio/popen.c b/libc/stdio/popen.c
index a07c411eb..7a00e570f 100644
--- a/libc/stdio/popen.c
+++ b/libc/stdio/popen.c
@@ -4,16 +4,14 @@
#include <sys/wait.h>
-FILE *popen(command, rw)
-char *command;
-char *rw;
+FILE *popen (const char *command, const char *modes)
{
int pipe_fd[2];
int pid, reading;
if (pipe(pipe_fd) < 0)
return NULL;
- reading = (rw[0] == 'r');
+ reading = (modes[0] == 'r');
pid = vfork();
if (pid < 0) {
@@ -34,11 +32,10 @@ char *rw;
}
close(pipe_fd[reading]);
- return fdopen(pipe_fd[!reading], rw);
+ return fdopen(pipe_fd[!reading], modes);
}
-int pclose(fd)
-FILE *fd;
+int pclose(FILE *fd)
{
int waitstat;