Bug 795480 - Make b2g app ensure that it's the process group controller. r=cjones

This commit is contained in:
Dave Hylands 2012-09-28 16:11:03 -07:00
parent 1feb80b867
commit 4b576069dc

View File

@ -12,6 +12,7 @@
#elif defined(XP_UNIX)
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#endif
#include <stdio.h>
@ -169,6 +170,15 @@ int main(int argc, char* argv[])
strcpy(++lastSlash, XPCOM_DLL);
#if defined(XP_UNIX)
// If the b2g app is launched from adb shell, then the shell will wind
// up being the process group controller. This means that we can't send
// signals to the process group (useful for profiling).
// We ignore the return value since setsid() fails if we're already the
// process group controller (the normal situation).
(void)setsid();
#endif
int gotCounters;
#if defined(XP_UNIX)
struct rusage initialRUsage;