* configure.ac: Check for waitpid.
* ser-pipe.c (pipe_close): Wait for the program to exit.
+2010-09-02 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config.in, configure: Regenerated.
+ * configure.ac: Check for waitpid.
+ * ser-pipe.c (pipe_close): Wait for the program to exit.
+
2010-09-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* cli-logging.c: Include gdb_assert.h.
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
+/* Define to 1 if you have the `waitpid' function. */
+#undef HAVE_WAITPID
+
/* Define to 1 if you have the <wait.h> header file. */
#undef HAVE_WAIT_H
getgid pipe poll pread64 resize_term sbrk setpgid setpgrp setsid \
sigaction sigprocmask sigsetmask socketpair syscall \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
- setrlimit getrlimit posix_madvise
+ setrlimit getrlimit posix_madvise waitpid
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
getgid pipe poll pread64 resize_term sbrk setpgid setpgrp setsid \
sigaction sigprocmask sigsetmask socketpair syscall \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
- setrlimit getrlimit posix_madvise])
+ setrlimit getrlimit posix_madvise waitpid])
AM_LANGINFO_CODESET
# Check the return and argument types of ptrace. No canned test for
#include <sys/time.h>
#include <fcntl.h>
#include "gdb_string.h"
+#include "gdb_wait.h"
#include <signal.h>
if (state != NULL)
{
+ int status;
kill (state->pid, SIGTERM);
- /* Might be useful to check that the child does die,
- and while we're waiting for it to die print any remaining
- stderr output. */
-
+#ifdef HAVE_WAITPID
+ /* Assume the program will exit after SIGTERM. Might be
+ useful to print any remaining stderr output from
+ scb->error_fd while waiting. */
+ waitpid (state->pid, &status, 0);
+#endif
if (scb->error_fd != -1)
close (scb->error_fd);
scb->error_fd = -1;