From: Po Lu Date: Wed, 26 Oct 2022 06:59:49 +0000 (+0800) Subject: Fix Haiku build for recent changes to system headers X-Git-Tag: emacs-29.0.90~1616^2~462 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=832bd2dfe51b2b9ea5e0e56e0e6ee60b2d8ae2ed;p=emacs.git 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. --- 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;