diff options
author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-11-19 17:31:50 +0000 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-11-19 17:31:50 +0000 |
commit | 7fe79165fe05dfb464a9e0753dc21470e7a1eebd (patch) | |
tree | dd11e9c1e254b3edf55a5b12326313f40d6b158c /init | |
parent | 299c6048c5643bcc1e4ac2f8cf9b569b85c333b0 (diff) | |
download | system_core-7fe79165fe05dfb464a9e0753dc21470e7a1eebd.zip system_core-7fe79165fe05dfb464a9e0753dc21470e7a1eebd.tar.gz system_core-7fe79165fe05dfb464a9e0753dc21470e7a1eebd.tar.bz2 |
Revert "init: Implement exec support"
This reverts commit 2f0ed0d3ced82e53b1fc1f994c6bd3e97683264c.
Change-Id: Ia0754c913da3d20c4e0c207ca479c043d394944e
Diffstat (limited to 'init')
-rw-r--r-- | init/builtins.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/init/builtins.c b/init/builtins.c index 6d52b21..f8922df 100644 --- a/init/builtins.c +++ b/init/builtins.c @@ -24,7 +24,6 @@ #include <linux/kd.h> #include <errno.h> #include <sys/socket.h> -#include <sys/wait.h> #include <netinet/in.h> #include <linux/if.h> #include <arpa/inet.h> @@ -259,42 +258,9 @@ int do_domainname(int nargs, char **args) return write_file("/proc/sys/kernel/domainname", args[1]); } -/*exec <path> <arg1> <arg2> ... */ -#define MAX_PARAMETERS 64 int do_exec(int nargs, char **args) { - pid_t pid; - int status, i, j; - char *par[MAX_PARAMETERS]; - if (nargs > MAX_PARAMETERS) - { - return -1; - } - for(i=0, j=1; i<(nargs-1) ;i++,j++) - { - par[i] = args[j]; - } - par[i] = (char*)0; - pid = fork(); - if (!pid) - { - char tmp[32]; - int fd, sz; - get_property_workspace(&fd, &sz); - sprintf(tmp, "%d,%d", dup(fd), sz); - setenv("ANDROID_PROPERTY_WORKSPACE", tmp, 1); - execve(par[0],par,environ); - exit(0); - } - else - { - while (waitpid(pid, &status, 0) == -1 && errno == EINTR); - if (WEXITSTATUS(status) != 0) { - ERROR("exec: pid %1d exited with return code %d: %s", (int)pid, WEXITSTATUS(status), strerror(status)); - } - - } - return 0; + return -1; } int do_export(int nargs, char **args) |