From: Daniel Jacobowitz Date: Thu, 2 Sep 2010 17:12:38 +0000 (+0000) Subject: * config.in, configure: Regenerated. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a4f61e3e4c32971615274aed323a1be06117551;p=binutils-gdb.git * config.in, configure: Regenerated. * configure.ac: Check for waitpid. * ser-pipe.c (pipe_close): Wait for the program to exit. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cf7f2bd4128..701952349ca 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2010-09-02 Daniel Jacobowitz + + * 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 * cli-logging.c: Include gdb_assert.h. diff --git a/gdb/config.in b/gdb/config.in index 76591812c39..173cd3d8b47 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -676,6 +676,9 @@ /* Define to 1 if you have the 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 header file. */ #undef HAVE_WAIT_H diff --git a/gdb/configure b/gdb/configure index 5563baed66a..2c7db685a54 100755 --- a/gdb/configure +++ b/gdb/configure @@ -12550,7 +12550,7 @@ for ac_func in canonicalize_file_name realpath getrusage getuid \ 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" diff --git a/gdb/configure.ac b/gdb/configure.ac index 4b779aafc4c..2f8090e512a 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -962,7 +962,7 @@ AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid \ 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 diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c index d26dc4fa497..5b439f7c368 100644 --- a/gdb/ser-pipe.c +++ b/gdb/ser-pipe.c @@ -31,6 +31,7 @@ #include #include #include "gdb_string.h" +#include "gdb_wait.h" #include @@ -162,11 +163,14 @@ pipe_close (struct serial *scb) 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;