return error;
error = posix_spawn_file_actions_adddup2 (actions, std_in,
- STDIN_FILENO);
+ STDIN_FILENO);
if (error != 0)
goto out;
error = posix_spawn_file_actions_adddup2 (actions, std_out,
- STDOUT_FILENO);
+ STDOUT_FILENO);
if (error != 0)
goto out;
error = posix_spawn_file_actions_adddup2 (actions,
- std_err < 0 ? std_out
- : std_err,
- STDERR_FILENO);
+ std_err < 0 ? std_out
+ : std_err,
+ STDERR_FILENO);
if (error != 0)
goto out;
- error =
-#ifdef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
- posix_spawn_file_actions_addchdir
+ /* Haiku appears to have linkable posix_spawn_file_actions_chdir,
+ but it always fails. So use the _np function instead. */
+#if defined HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR && !defined HAIKU
+ error = posix_spawn_file_actions_addchdir (actions, cwd);
#else
- posix_spawn_file_actions_addchdir_np
+ error = posix_spawn_file_actions_addchdir_np (actions, cwd);
#endif
- (actions, cwd);
if (error != 0)
goto out;
return error;
error = posix_spawnattr_setflags (attributes,
- POSIX_SPAWN_SETSID
- | POSIX_SPAWN_SETSIGDEF
- | POSIX_SPAWN_SETSIGMASK);
+ POSIX_SPAWN_SETSID
+ | POSIX_SPAWN_SETSIGDEF
+ | POSIX_SPAWN_SETSIGMASK);
if (error != 0)
goto out;