]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- (dtucker) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
authorDarren Tucker <dtucker@zip.com.au>
Wed, 13 Aug 2003 10:48:07 +0000 (20:48 +1000)
committerDarren Tucker <dtucker@zip.com.au>
Wed, 13 Aug 2003 10:48:07 +0000 (20:48 +1000)
   Add a tcsendbreak function for platforms that don't have one, based on the
   one from OpenBSD.

Any more of these and I'll split them out into bsd-termio.[ch].

ChangeLog
configure.ac
openbsd-compat/bsd-misc.c
openbsd-compat/bsd-misc.h

index 2140b20c8405c500d8385a12b575871e27b046d6..47e97438b985f149d103eb51b1165e6b0099f9fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,9 @@
    - markus@cvs.openbsd.org 2003/08/13 09:07:10
      [readconf.c ssh.c]
      socks4->socks, since with support both 4 and 5; dtucker@zip.com.au
+ - (dtucker) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
+   Add a tcsendbreak function for platforms that don't have one, based on the
+   one from OpenBSD.
 
 20030811
  - (dtucker) OpenBSD CVS Sync
  - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
    Report from murple@murple.net, diagnosis from dtucker@zip.com.au
 
-$Id: ChangeLog,v 1.2892 2003/08/13 10:38:36 dtucker Exp $
+$Id: ChangeLog,v 1.2893 2003/08/13 10:48:07 dtucker Exp $
index 68fa5c1f2b74debac256894634015bc7f709a2eb..9644dcaf2a1d3c3949c100703278f35680eac698 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.138 2003/08/02 12:24:49 dtucker Exp $
+# $Id: configure.ac,v 1.139 2003/08/13 10:48:07 dtucker Exp $
 
 AC_INIT
 AC_CONFIG_SRCDIR([ssh.c])
@@ -695,8 +695,8 @@ AC_CHECK_FUNCS(\
        setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
        setproctitle setregid setresgid setresuid setreuid setrlimit \
        setsid setvbuf sigaction sigvec snprintf socketpair strerror \
-       strlcat strlcpy strmode strnvis sysconf tcgetpgrp truncate utimes \
-       vhangup vsnprintf waitpid \
+       strlcat strlcpy strmode strnvis sysconf tcgetpgrp tcsendbreak \
+       truncate utimes vhangup vsnprintf waitpid \
 )
 
 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
index da8f77046c6285e6671551be40997e3a9c2129fa..d4c7937244667d6883ef518b8c588a1cd45a3281 100644 (file)
@@ -25,7 +25,7 @@
 #include "includes.h"
 #include "xmalloc.h"
 
-RCSID("$Id: bsd-misc.c,v 1.16 2003/08/02 14:36:16 dtucker Exp $");
+RCSID("$Id: bsd-misc.c,v 1.17 2003/08/13 10:48:07 dtucker Exp $");
 
 /*
  * NB. duplicate __progname in case it is an alias for argv[0]
@@ -180,3 +180,23 @@ tcgetpgrp(int fd)
 }
 #endif /* HAVE_TCGETPGRP */
 
+#ifndef HAVE_TCSENDBREAK
+int
+tcsendbreak(int fd, int duration)
+{
+# if defined(TIOCSBRK) && defined(TIOCCBRK)
+       struct timeval sleepytime;
+
+       sleepytime.tv_sec = 0;
+       sleepytime.tv_usec = 400000;
+       if (ioctl(fd, TIOCSBRK, 0) == -1)
+               return (-1);
+       (void)select(0, 0, 0, 0, &sleepytime);
+       if (ioctl(fd, TIOCCBRK, 0) == -1)
+               return (-1);
+       return (0);
+# else
+       return -1;
+# endif
+}
+#endif /* HAVE_TCSENDBREAK */
index 03a1f3af0771b7325f990ea890525034ede65dcb..f2fbdc2e3c17ae38cdba615eb3382bb60f865fef 100644 (file)
@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* $Id: bsd-misc.h,v 1.9 2003/08/02 13:31:42 dtucker Exp $ */
+/* $Id: bsd-misc.h,v 1.10 2003/08/13 10:48:07 dtucker Exp $ */
 
 #ifndef _BSD_MISC_H
 #define _BSD_MISC_H
@@ -91,6 +91,10 @@ int nanosleep(const struct timespec *, struct timespec *);
 
 #ifndef HAVE_TCGETPGRP
 pid_t tcgetpgrp(int);
-#endif /* HAVE_TCGETPGRP */
+#endif
+
+#ifndef HAVE_TCSENDBREAK
+int tcsendbreak(int, int);
+#endif
 
 #endif /* _BSD_MISC_H */