X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fplat%2FPOSIX.cc;fp=src%2Forg%2Fxwt%2Fplat%2FPOSIX.cc;h=0000000000000000000000000000000000000000;hb=3591b88b94a6bb378af3d4abe6eb5233ce583104;hp=209c37a36844b20a51e77b8ee64b146c68400f57;hpb=de378041d5ca2aca1a2b5a31ef15ae90a86c977f;p=org.ibex.core.git diff --git a/src/org/xwt/plat/POSIX.cc b/src/org/xwt/plat/POSIX.cc deleted file mode 100644 index 209c37a..0000000 --- a/src/org/xwt/plat/POSIX.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2002 Adam Megacz, see the COPYING file for licensing [LGPL] -// see below for copyright information on the second portion of this file - -#include "GCJ.cc" - -#include -#include -#include -#include -#include -#include -#include -#include - -// FIXME: we don't need all these -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -jstring org::xwt::plat::POSIX::_getEnv(jstring key) { - int len = JvGetStringUTFLength(key); - char buf[len + 1]; - JvGetStringUTFRegion(key, 0, len, buf); - buf[len] = '\0'; - char* envstr = getenv(buf); - return envstr == NULL ? NULL : JvNewStringLatin1(envstr); -} - -void org::xwt::plat::POSIX::spawnChildProcess(JArray* cmd) { - jstring* cmdstrings = elements(cmd); - char* cmd2[cmd->length + 1]; - cmd2[cmd->length] = NULL; - for(int i=0; ilength; i++) { - cmd2[i] = (char*)malloc(JvGetStringUTFLength(cmdstrings[i])); - JvGetStringUTFRegion(cmdstrings[i], 0, JvGetStringUTFLength(cmdstrings[i]), cmd2[i]); - } - - if (!fork()) { - signal(SIGHUP, SIG_IGN); - signal(SIGQUIT, SIG_IGN); - signal(SIGINT, SIG_IGN); - signal(SIGTERM, SIG_IGN); - - // ignore SIGPIPE in case we were launched from a browser and the browser closed - signal(SIGPIPE, SIG_IGN); - - execvp(cmd2[0], cmd2); - } -} -