diff options
Diffstat (limited to 'libc/stdio/popen.c')
-rw-r--r-- | libc/stdio/popen.c | 11 |
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; |