2013-09-29 Paul Smith <psmith@gnu.org>
+ * function.c (func_shell_base) [EMX]: Fix EMX support for output-sync.
+ * job.c (child_execute_job) [EMX]: Ditto.
+ * job.h (child_execute_job) [EMX]: Ditto.
+ * w32/compat/posixfcn.c: Invert the test for NO_OUTPUT_SYNC.
+
* guile.c (GSUBR_TYPE): Pre-2.0 Guile doesn't provide a typedef
for gsubr pointers. Create one.
(guile_define_module): Use it.
#endif
/* Using a target environment for 'shell' loses in cases like:
- export var = $(shell echo foobie)
- because target_environment hits a loop trying to expand $(var)
- to put it in the environment. This is even more confusing when
- var was not explicitly exported, but just appeared in the
- calling environment.
+ export var = $(shell echo foobie)
+ bad := $(var)
+ because target_environment hits a loop trying to expand $(var) to put it
+ in the environment. This is even more confusing when var was not
+ explicitly exported, but just appeared in the calling environment.
See Savannah bug #10593.
- envp = target_environment (NILF);
+ envp = target_environment (NULL);
*/
envp = environ;
CLOSE_ON_EXEC(pipedes[1]);
CLOSE_ON_EXEC(pipedes[0]);
/* Never use fork()/exec() here! Use spawn() instead in exec_command() */
- pid = child_execute_job (FD_STDIN, pipedes[1], FD_STDOUT, command_argv, envp);
+ pid = child_execute_job (FD_STDIN, pipedes[1], FD_STDERR, command_argv, envp);
if (pid < 0)
perror_with_name (error_prefix, "spawn");
# else /* ! __EMX__ */
/* Restore stdout/stdin/stderr of the parent and close temporary FDs. */
if (save_stdin >= 0)
{
- if (dup2 (save_stdin, FD_STDIN) != 0)
+ if (dup2 (save_stdin, FD_STDIN) != FD_STDIN)
fatal (NILF, _("Could not restore stdin\n"));
else
close (save_stdin);
if (save_stdout >= 0)
{
- if (dup2 (save_stdout, FD_STDOUT) != 0)
+ if (dup2 (save_stdout, FD_STDOUT) != FD_STDOUT)
fatal (NILF, _("Could not restore stdout\n"));
else
close (save_stdout);
if (save_stderr >= 0)
{
- if (dup2 (save_stderr, FD_STDERR) != 0)
+ if (dup2 (save_stderr, FD_STDERR) != FD_STDERR)
fatal (NILF, _("Could not restore stderr\n"));
else
close (save_stderr);
# define FD_STDERR (fileno (stderr))
# if defined(__EMX__)
int child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
- char **argv, char **envp)
+ char **argv, char **envp);
# else
void child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
char **argv, char **envp) __attribute__ ((noreturn));
#include "makeint.h"
#include "job.h"
-#ifdef NO_OUTPUT_SYNC
+#ifndef NO_OUTPUT_SYNC
/* Support for OUTPUT_SYNC and related functionality. */
/* Emulation of fcntl that supports only F_GETFD and F_SETLKW. */