-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CWD option to subprocess_create_ex #83
base: master
Are you sure you want to change the base?
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_np
function (from the screenshot) and aposix_spawn_file_actions_addchdir
function, 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.