From f893d5431d49142667d11d24510707dff6d49a56 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@hadrons.org>
Date: Fri, 16 Aug 2019 00:34:03 +0200
Subject: [PATCH 60/60] telnet: Several ioctls have been disabled in the Hurd's
 glibc

But not the related option macros. inetutils uses those macros to decide
whether the ioctls are available, so it is FTBFS now. The Hurd's glibc
is being fixed, but we'll use this for now to get the builds going.
---
 telnet/sys_bsd.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/telnet/sys_bsd.c b/telnet/sys_bsd.c
index 662536ab..5eb35cb5 100644
--- a/telnet/sys_bsd.c
+++ b/telnet/sys_bsd.c
@@ -63,6 +63,7 @@
 #include <errno.h>
 #include <arpa/telnet.h>
 #include <sys/select.h>
+#include <sys/ioctl.h>
 #include <unused-parameter.h>
 
 #include "ring.h"
@@ -157,7 +158,7 @@ TerminalRead (char *buf, int n)
 int
 TerminalAutoFlush (void)
 {
-#if defined LNOFLSH
+#if defined TIOCLGET && defined LNOFLSH
   int flush;
 
   ioctl (0, TIOCLGET, (char *) &flush);
@@ -260,7 +261,9 @@ TerminalSaveState (void)
   ioctl (0, TIOCGETP, (char *) &ottyb);
   ioctl (0, TIOCGETC, (char *) &otc);
   ioctl (0, TIOCGLTC, (char *) &oltc);
+#ifdef TIOCLGET
   ioctl (0, TIOCLGET, (char *) &olmode);
+#endif
 
   ntc = otc;
   nltc = oltc;
@@ -755,7 +758,9 @@ TerminalNewMode (register int f)
 #endif
     }
 #ifndef USE_TERMIO
+#ifdef TIOCLSET
   ioctl (tin, TIOCLSET, (char *) &lmode);
+#endif
   ioctl (tin, TIOCSLTC, (char *) &ltc);
   ioctl (tin, TIOCSETC, (char *) &tc);
   ioctl (tin, TIOCSETN, (char *) &sb);
-- 
2.26.0.292.g33ef6b2f38

