From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10864 invoked by alias); 16 Mar 2005 16:33:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10614 invoked from network); 16 Mar 2005 16:33:03 -0000 Received: from unknown (HELO sethra.codesourcery.com) (65.74.133.9) by sourceware.org with SMTP; 16 Mar 2005 16:33:03 -0000 Received: from sethra.codesourcery.com (localhost.localdomain [127.0.0.1]) by sethra.codesourcery.com (8.12.11/8.12.11) with ESMTP id j2GGX3kM020757 for ; Wed, 16 Mar 2005 08:33:03 -0800 Received: (from mitchell@localhost) by sethra.codesourcery.com (8.12.11/8.12.11/Submit) id j2GGX3Fl020753; Wed, 16 Mar 2005 08:33:03 -0800 Date: Wed, 16 Mar 2005 16:33:00 -0000 Message-Id: <200503161633.j2GGX3Fl020753@sethra.codesourcery.com> From: Mark Mitchell To: gdb-patches@sources.redhat.com Subject: PATCH: Allow for systems that do not define SIGQUIT/SIGPIPE Reply-to: mark@codesourcery.com X-SW-Source: 2005-03/txt/msg00212.txt.bz2 Windows does not have SIGQUIT or SIGPIPE. Tested on x86_64-unknown-linux-gnu. OK? -- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com 2005-03-16 Mark Mitchell * event-top.c (async_init_signals): Allow for systems that do not define SIGQUIT. * ser-tcp.c (net_open): Allow for systems that do not have SIGPIPE. Index: event-top.c =================================================================== RCS file: /cvs/src/src/gdb/event-top.c,v retrieving revision 1.39 diff -c -5 -p -r1.39 event-top.c *** event-top.c 12 Feb 2005 00:39:19 -0000 1.39 --- event-top.c 16 Mar 2005 16:07:44 -0000 *************** async_init_signals (void) *** 893,902 **** --- 893,903 ---- to the inferior and breakpoints will be ignored. */ #ifdef SIGTRAP signal (SIGTRAP, SIG_DFL); #endif + #ifdef SIGQUIT /* If we initialize SIGQUIT to SIG_IGN, then the SIG_IGN will get passed to the inferior, which we don't want. It would be possible to do a "signal (SIGQUIT, SIG_DFL)" after we fork, but on BSD4.3 systems using vfork, that can affect the GDB process as well as the inferior (the signal handling tables *************** async_init_signals (void) *** 904,913 **** --- 905,915 ---- a handler for SIGQUIT, when we call exec it will set the signal to SIG_DFL for us. */ signal (SIGQUIT, handle_sigquit); sigquit_token = create_async_signal_handler (async_do_nothing, NULL); + #endif #ifdef SIGHUP if (signal (SIGHUP, handle_sighup) != SIG_IGN) sighup_token = create_async_signal_handler (async_disconnect, NULL); else Index: ser-tcp.c =================================================================== RCS file: /cvs/src/src/gdb/ser-tcp.c,v retrieving revision 1.17 diff -c -5 -p -r1.17 ser-tcp.c *** ser-tcp.c 11 Feb 2005 04:06:04 -0000 1.17 --- ser-tcp.c 16 Mar 2005 16:07:44 -0000 *************** net_open (struct serial *scb, const char *** 184,196 **** --- 184,198 ---- tmp = 1; setsockopt (scb->fd, IPPROTO_TCP, TCP_NODELAY, (char *)&tmp, sizeof (tmp)); } + #ifdef SIGPIPE /* If we don't do this, then GDB simply exits when the remote side dies. */ signal (SIGPIPE, SIG_IGN); + #endif return 0; } static void