summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-10-26 14:59:49 +0800
committerPo Lu <luangruo@yahoo.com>2022-10-26 15:00:35 +0800
commit832bd2dfe51b2b9ea5e0e56e0e6ee60b2d8ae2ed (patch)
treefb91e057332f98ffc155f5c7b86b94be82c339ff
parent5ad5b797f78dacb9c901d3c63bee05b1762fa94f (diff)
downloademacs-832bd2dfe51b2b9ea5e0e56e0e6ee60b2d8ae2ed.tar.gz
Fix Haiku build for recent changes to system headers
* src/callproc.c (emacs_posix_spawn_init_actions): Do not use posix_spawn_file_actions_addchdir on Haiku; it links but does not work.
-rw-r--r--src/callproc.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 2d457b3c84c..1337d2b9de1 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1306,29 +1306,29 @@ emacs_posix_spawn_init_actions (posix_spawn_file_actions_t *actions,
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;
@@ -1347,9 +1347,9 @@ emacs_posix_spawn_init_attributes (posix_spawnattr_t *attributes,
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;