Add CWD option to subprocess_create_ex#83
Conversation
|
As far as I know (not an expert either) the |
|
I was a getting a segfault with this PR version and I figured out how to fix it by making the following change to int subprocess_create(const char *const commandLine[], int options,
struct subprocess_s *const out_process) {
return subprocess_create_ex(commandLine, options, SUBPROCESS_NULL,
// out_process, SUBPROCESS_NULL);
out_process, ".") |
|
It will need to be SUBPROCESS_NULL on windows, I suspect a better fix will be to check if cwd is null, and if so, skip the call to |
|
I have implemented the requested changes. Before doing so, I noticed some tests on ubuntu had failed with:
I assume this is because the function is missing, but this function is imported via the |
|
Yeah we're gonna have to find another function we can use on Linux it seems. I'll have a google about. |
Closes #52.
Disclaimer: I am not a posix developer. I verified the Windows code works, but did not test the UNIX stuff. I just copied this code from that issue without testing:
I did notice that there was a
posix_spawn_file_actions_addchdir_npfunction (from the screenshot) and aposix_spawn_file_actions_addchdirfunction, the latter of which is "portable" and the former is "non-portable". I don't really understand what that means in this context, however when searching I did notice that Rust uses the "non-portable" variation, so I'm guessing it's the preferred one.