From: Gary Benson Date: Wed, 6 Aug 2014 10:57:14 +0000 (+0100) Subject: Downgrade fatal to warning in linux_async X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aa96c426c674844a90e8fbea2cd184462191b498;p=binutils-gdb.git Downgrade fatal to warning in linux_async This commit downgrades a fatal error to a warning in linux_async. linux_async is called from two different places in gdbserver: Via target_async from handle_accept_event. The argument is always zero, so the warning will never be printed here. Via start_non_stop from handle_general_set. This prints its own error message to stderr on failure, which will be preceded by the warning if it is emitted. gdb/gdbserver/ChangeLog: * linux-low.c (linux_async): Replace fatal with warning. Tidy up and return. (linux_start_non_stop): Return -1 if linux_async failed. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index ec3fc93a95f..c3e4c935f06 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2014-08-28 Gary Benson + + * linux-low.c (linux_async): Replace fatal with warning. + Tidy up and return. + (linux_start_non_stop): Return -1 if linux_async failed. + 2014-08-28 Gary Benson * linux-x86-low.c (i386_dr_low_set_addr): Replace check with diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index f8b3e68ff2c..ec3260e1bc8 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -5107,7 +5107,14 @@ linux_async (int enable) if (enable) { if (pipe (linux_event_pipe) == -1) - fatal ("creating event pipe failed."); + { + linux_event_pipe[0] = -1; + linux_event_pipe[1] = -1; + sigprocmask (SIG_UNBLOCK, &mask, NULL); + + warning ("creating event pipe failed."); + return previous; + } fcntl (linux_event_pipe[0], F_SETFL, O_NONBLOCK); fcntl (linux_event_pipe[1], F_SETFL, O_NONBLOCK); @@ -5140,6 +5147,10 @@ linux_start_non_stop (int nonstop) { /* Register or unregister from event-loop accordingly. */ linux_async (nonstop); + + if (target_is_async_p () != (nonstop != 0)) + return -1; + return 0; }