aboutsummaryrefslogtreecommitdiff
path: root/sim/common/dv-sockser.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-09-09 01:44:24 -0400
committerMike Frysinger <vapier@gentoo.org>2021-09-09 02:24:00 -0400
commitee73abf25e8431f4ea8c95629622cf23515c1d07 (patch)
treeeba853878b31f0ed2ec763a5c5f97b921f1df5b2 /sim/common/dv-sockser.c
parent03de8f26e8286f6160a9fcd6b082893ed850e8fa (diff)
downloadbinutils-ee73abf25e8431f4ea8c95629622cf23515c1d07.zip
binutils-ee73abf25e8431f4ea8c95629622cf23515c1d07.tar.gz
binutils-ee73abf25e8431f4ea8c95629622cf23515c1d07.tar.bz2
sim: drop old O_NDELAY & FNBLOCK support
We use these older names inconsistently in the sim codebase, and time has moved on long ago, so drop support for these non-standard names. POSIX provides O_NONBLOCK for us, so use it everywhere.
Diffstat (limited to 'sim/common/dv-sockser.c')
-rw-r--r--sim/common/dv-sockser.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c
index 7950943..477e8f6 100644
--- a/sim/common/dv-sockser.c
+++ b/sim/common/dv-sockser.c
@@ -49,24 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
-
-/* Get definitions for both O_NONBLOCK and O_NDELAY. */
-
-#ifndef O_NDELAY
-#ifdef FNDELAY
-#define O_NDELAY FNDELAY
-#else /* ! defined (FNDELAY) */
-#define O_NDELAY 0
-#endif /* ! defined (FNDELAY) */
-#endif /* ! defined (O_NDELAY) */
-
-#ifndef O_NONBLOCK
-#ifdef FNBLOCK
-#define O_NONBLOCK FNBLOCK
-#else /* ! defined (FNBLOCK) */
-#define O_NONBLOCK 0
-#endif /* ! defined (FNBLOCK) */
-#endif /* ! defined (O_NONBLOCK) */
/* Compromise between eating cpu and properly busy-waiting.
@@ -274,9 +256,9 @@ connected_p (SIM_DESC sd)
return 0;
/* Set non-blocking i/o. */
-#ifdef F_GETFL
+#if defined(F_GETFL) && defined(O_NONBLOCK)
flags = fcntl (sockser_fd, F_GETFL);
- flags |= O_NONBLOCK | O_NDELAY;
+ flags |= O_NONBLOCK;
if (fcntl (sockser_fd, F_SETFL, flags) == -1)
{
sim_io_eprintf (sd, "unable to set nonblocking i/o");