diff options
author | David Robillard <d@drobilla.net> | 2007-07-31 16:24:31 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-07-31 16:24:31 +0000 |
commit | 090b31c8012dab19d7666a96cb2d3c8b272bc885 (patch) | |
tree | d485cb5e50faa4a17ab2ede9998c54efb4c15a0e /raul | |
parent | 61c703a6fe358770c9616b91b26fefc7052a285a (diff) | |
download | raul-090b31c8012dab19d7666a96cb2d3c8b272bc885.tar.gz raul-090b31c8012dab19d7666a96cb2d3c8b272bc885.tar.bz2 raul-090b31c8012dab19d7666a96cb2d3c8b272bc885.zip |
SWIG building fixes.
Applied patch from silverblade to fix Raul Process cmd line parameters.
Fixed launching internal engine from Connect dialog.
Fix nasty crashes caused by overly hasty last commit.
git-svn-id: http://svn.drobilla.net/lad/raul@662 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul')
-rw-r--r-- | raul/Process.hpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/raul/Process.hpp b/raul/Process.hpp index 80063a1..2f5e286 100644 --- a/raul/Process.hpp +++ b/raul/Process.hpp @@ -46,27 +46,29 @@ public: ? command.substr(0, command.find(" ")) : command; - std::cerr << "Launching child process '" << executable << "' with command line '" - << command << "'" << std::endl; + const std::string arguments = command.substr((command.find(" ") + 1)); - // Use the same double fork() trick as JACK to prevent zombie children - const int err = fork(); + std::cerr << "Launching child process '" << executable << "' with arguments '" + << arguments << "'" << std::endl; - if (err == 0) { - // (child) + // Use the same double fork() trick as JACK to prevent zombie children + const int err = fork(); - // close all nonstandard file descriptors - struct rlimit max_fds; - getrlimit(RLIMIT_NOFILE, &max_fds); + if (err == 0) { + // (child) - for (rlim_t fd = 3; fd < max_fds.rlim_cur; ++fd) - close(fd); + // close all nonstandard file descriptors + struct rlimit max_fds; + getrlimit(RLIMIT_NOFILE, &max_fds); - switch (fork()) { - case 0: - // (grandchild) - setsid(); - execlp(executable.c_str(), command.c_str(), NULL); + for (rlim_t fd = 3; fd < max_fds.rlim_cur; ++fd) + close(fd); + + switch (fork()) { + case 0: + // (grandchild) + setsid(); + execlp(executable.c_str(), arguments.c_str(), NULL); _exit(-1); case -1: |