From 38066b6f19033431052e45861a1671dfb23ea0de Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 29 Sep 2013 13:17:56 -0400 Subject: Fix build failures on EMX for output-sync support. --- ChangeLog | 5 +++++ function.c | 14 +++++++------- job.c | 6 +++--- job.h | 2 +- w32/compat/posixfcn.c | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14ea56d..0831076 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2013-09-29 Paul Smith + * 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. diff --git a/function.c b/function.c index 866ac48..b8b9cf3 100644 --- a/function.c +++ b/function.c @@ -1652,15 +1652,15 @@ func_shell_base (char *o, char **argv, int trim_newlines) #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; @@ -1710,7 +1710,7 @@ func_shell_base (char *o, char **argv, int trim_newlines) 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__ */ diff --git a/job.c b/job.c index 12b0ff6..febfac0 100644 --- a/job.c +++ b/job.c @@ -2234,7 +2234,7 @@ child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd, /* 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); @@ -2242,7 +2242,7 @@ child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd, 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); @@ -2250,7 +2250,7 @@ child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd, 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); diff --git a/job.h b/job.h index c97f7c0..8a20177 100644 --- a/job.h +++ b/job.h @@ -128,7 +128,7 @@ int child_execute_job (char *argv, struct child *child); # 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)); diff --git a/w32/compat/posixfcn.c b/w32/compat/posixfcn.c index 627fc50..cde81ce 100644 --- a/w32/compat/posixfcn.c +++ b/w32/compat/posixfcn.c @@ -26,7 +26,7 @@ this program. If not, see . */ #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. */ -- cgit v1.2.3