mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 14:53:03 +00:00
Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
* lib/bitset.c (bitset_print): Don't assume size_t can be printed with %d format. * lib/ebitset.c (min, max): Undef before defining. * lib/vbitset.c (min, max): Likewise. * lib/subpipe.c (create_subpipe): Save local variables in case vfork clobbers them. * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the error message syntax used by gcc-4.0.
This commit is contained in:
@@ -114,6 +114,13 @@ create_subpipe (char const * const *argv, int fd[2])
|
||||
|| (from_out_fd = fd_safer (pipe_fd[1])) < 0)
|
||||
error (EXIT_FAILURE, errno, "pipe");
|
||||
|
||||
/* Save the local variables in the parent now, in case vfork
|
||||
clobbers them. */
|
||||
fd[0] = to_out_fd;
|
||||
fd[1] = from_in_fd;
|
||||
pipe_fd[0] = to_in_fd;
|
||||
pipe_fd[1] = from_out_fd;
|
||||
|
||||
pid = vfork ();
|
||||
if (pid < 0)
|
||||
error (EXIT_FAILURE, errno, "fork");
|
||||
@@ -137,10 +144,8 @@ create_subpipe (char const * const *argv, int fd[2])
|
||||
}
|
||||
|
||||
/* Parent. */
|
||||
close (to_in_fd);
|
||||
close (from_out_fd);
|
||||
fd[0] = to_out_fd;
|
||||
fd[1] = from_in_fd;
|
||||
close (pipe_fd[0]);
|
||||
close (pipe_fd[1]);
|
||||
return pid;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user