summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libugly/popen.c
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-05-06 02:43:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-05-06 02:43:04 +0000
commit4e506c9aefe5b89970ae6894d05ad53c81af0d83 (patch)
tree2fac98df209e72eaba773cad2d7b90c99d9d9249 /mdk-stage1/dietlibc/libugly/popen.c
parent793707b39bf2e9df40a6d2d60b83b3061088ae9e (diff)
downloaddrakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar
drakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.gz
drakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.bz2
drakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.xz
drakx-4e506c9aefe5b89970ae6894d05ad53c81af0d83.zip
use installed dietlibc, not our forked cvs version
Diffstat (limited to 'mdk-stage1/dietlibc/libugly/popen.c')
-rw-r--r--mdk-stage1/dietlibc/libugly/popen.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/mdk-stage1/dietlibc/libugly/popen.c b/mdk-stage1/dietlibc/libugly/popen.c
deleted file mode 100644
index aa9a2cde0..000000000
--- a/mdk-stage1/dietlibc/libugly/popen.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "dietstdio.h"
-#include <unistd.h>
-#include <fcntl.h>
-#include "binshstr.h"
-
-extern char **environ;
-
-FILE *popen(const char *command, const char *type) {
- int pfd[2];
- int fd0;
- FILE* f;
- pid_t pid;
-
- if (pipe(pfd)<0) return 0;
- fd0=(*type=='r');
- if (!(f=fdopen(pfd[!fd0],type))) {
- close(pfd[0]); /* malloc failed */
- close(pfd[1]);
- return 0;
- }
- if ((pid=fork())<0) {
- close(pfd[0]);
- close(pfd[1]);
- return 0;
- }
- if (!pid) { /* child */
- const char *argv[]={__sh,"-c",0,0};
- close(pfd[!fd0]); close(fd0);
- dup2(pfd[fd0],fd0); close(pfd[fd0]);
- argv[2]=command;
- execve(__binsh,(char*const*)argv,environ);
- _exit(127);
- }
- close(pfd[fd0]);
- fcntl (pfd[!fd0], F_SETFD, FD_CLOEXEC);
- f->popen_kludge=pid;
- return f;
-}