summaryrefslogtreecommitdiff
path: root/drivers/unix/os_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix/os_unix.cpp')
-rw-r--r--drivers/unix/os_unix.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 13bb866503..36560eb736 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -39,7 +39,6 @@
#include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/file_access_unix.h"
#include "drivers/unix/net_socket_posix.h"
-#include "drivers/unix/rw_lock_posix.h"
#include "drivers/unix/thread_posix.h"
#include "servers/rendering_server.h"
@@ -119,10 +118,8 @@ int OS_Unix::unix_initialize_audio(int p_audio_driver) {
void OS_Unix::initialize_core() {
#ifdef NO_THREADS
ThreadDummy::make_default();
- RWLockDummy::make_default();
#else
ThreadPosix::make_default();
- RWLockPosix::make_default();
#endif
FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_RESOURCES);
FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_USERDATA);
@@ -299,16 +296,22 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, St
if (pid == 0) {
// The child process
- Vector<char *> args;
- args.push_back((char *)p_path.utf8().get_data());
+ Vector<CharString> cs;
+ cs.push_back(p_path.utf8());
for (int i = 0; i < p_arguments.size(); i++) {
- args.push_back((char *)p_arguments[i].utf8().get_data());
+ cs.push_back(p_arguments[i].utf8());
+ }
+
+ Vector<char *> args;
+ for (int i = 0; i < cs.size(); i++) {
+ args.push_back((char *)cs[i].get_data());
}
args.push_back(0);
execvp(p_path.utf8().get_data(), &args[0]);
// The execvp() function only returns if an error occurs.
- CRASH_NOW_MSG("Could not create child process: " + p_path);
+ ERR_PRINT("Could not create child process: " + p_path);
+ raise(SIGKILL);
}
int status;
@@ -335,16 +338,22 @@ Error OS_Unix::create_process(const String &p_path, const List<String> &p_argume
// This ensures the process won't go zombie at the end.
setsid();
- Vector<char *> args;
- args.push_back((char *)p_path.utf8().get_data());
+ Vector<CharString> cs;
+ cs.push_back(p_path.utf8());
for (int i = 0; i < p_arguments.size(); i++) {
- args.push_back((char *)p_arguments[i].utf8().get_data());
+ cs.push_back(p_arguments[i].utf8());
+ }
+
+ Vector<char *> args;
+ for (int i = 0; i < cs.size(); i++) {
+ args.push_back((char *)cs[i].get_data());
}
args.push_back(0);
execvp(p_path.utf8().get_data(), &args[0]);
// The execvp() function only returns if an error occurs.
- CRASH_NOW_MSG("Could not create child process: " + p_path);
+ ERR_PRINT("Could not create child process: " + p_path);
+ raise(SIGKILL);
}
if (r_child_id) {