From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id EF14138515F4 for ; Tue, 8 Jun 2021 05:10:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF14138515F4 Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 0A12F335D77 for ; Tue, 8 Jun 2021 05:10:42 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 3/3] sim: dv-sockser: enable for mingw targets too Date: Tue, 8 Jun 2021 01:10:36 -0400 Message-Id: <20210608051036.24813-3-vapier@gentoo.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210608051036.24813-1-vapier@gentoo.org> References: <20210608051036.24813-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 05:10:52 -0000 We have enough functionality from gnulib now to build sockser on all platforms. --- sim/common/dv-sockser.c | 6 +++++- sim/m4/sim_ac_option_hardware.m4 | 16 +++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c index 7f1cf798e4b9..f1ef22a53a8e 100644 --- a/sim/common/dv-sockser.c +++ b/sim/common/dv-sockser.c @@ -43,7 +43,7 @@ along with this program. If not, see . */ #include #ifndef __CYGWIN32__ -#include +//#include #endif #include "sim-assert.h" @@ -199,6 +199,7 @@ dv_sockser_init (SIM_DESC sd) /* Handle writes to missing client -> SIGPIPE. ??? Need a central signal management module. */ +#ifdef SIGPIPE { RETSIGTYPE (*orig) (); orig = signal (SIGPIPE, SIG_IGN); @@ -206,6 +207,7 @@ dv_sockser_init (SIM_DESC sd) if (orig != SIG_DFL && orig != SIG_IGN) signal (SIGPIPE, orig); } +#endif return SIM_RC_OK; } @@ -277,6 +279,7 @@ connected_p (SIM_DESC sd) return 0; /* Set non-blocking i/o. */ +#ifdef F_GETFL flags = fcntl (sockser_fd, F_GETFL); flags |= O_NONBLOCK | O_NDELAY; if (fcntl (sockser_fd, F_SETFL, flags) == -1) @@ -286,6 +289,7 @@ connected_p (SIM_DESC sd) sockser_fd = -1; return 0; } +#endif return 1; } diff --git a/sim/m4/sim_ac_option_hardware.m4 b/sim/m4/sim_ac_option_hardware.m4 index 75e331eb0b33..a4595cee056c 100644 --- a/sim/m4/sim_ac_option_hardware.m4 +++ b/sim/m4/sim_ac_option_hardware.m4 @@ -48,17 +48,11 @@ else *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";; esac done - # mingw does not support sockser - case ${host} in - *mingw*) ;; - *) # TODO: We don't add dv-sockser to sim_hw as it is not a "real" device - # that you instatiate. Instead, other code will call into it directly. - # At some point, we should convert it over. - sim_hw_objs="$sim_hw_objs dv-sockser.o" - AC_DEFINE_UNQUOTED( - [HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.]) - ;; - esac + dnl TODO: We don't add dv-sockser to sim_hw as it is not a "real" device + dnl that you instatiate. Instead, other code will call into it directly. + dnl At some point, we should convert it over. + sim_hw_objs="$sim_hw_objs dv-sockser.o" + AC_DEFINE_UNQUOTED([HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.]) if test x"$silent" != x"yes"; then echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs" fi -- 2.31.1