changeset 178:8beb7bfca92b

2003-6-11 Brian Masney <masneyb@gftp.org> * lib/configure.in lib/gftp.h - portability fix for openpty(). (from Nathan Robertson <nathanr@nathanr.net>, which he took from http://mail.python.org/pipermail/patches/2000-June/000953.html) * lib/pty.h - found out about #elif preprocessor macro ;)
author masneyb
date Wed, 11 Jun 2003 22:02:26 +0000
parents aec4b4541d3a
children 8d933999bba6
files ChangeLog configure.in lib/gftp.h lib/pty.c
diffstat 4 files changed, 17 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jun 10 12:03:54 2003 +0000
+++ b/ChangeLog	Wed Jun 11 22:02:26 2003 +0000
@@ -1,3 +1,10 @@
+2003-6-11 Brian Masney <masneyb@gftp.org>
+	* lib/configure.in lib/gftp.h - portability fix for openpty(). (from 
+	Nathan Robertson <nathanr@nathanr.net>, which he took from 
+	http://mail.python.org/pipermail/patches/2000-June/000953.html)
+
+	* lib/pty.h - found out about #elif preprocessor macro ;)
+
 2003-6-9 Brian Masney <masneyb@gftp.org>
 	* lib/bookmark.c lib/gftp.h lib/local.c lib/protocols.c lib/rfc2068.c
 	lib/rfc959.c lib/sshv2.c - make return value of *_set_config_options()
@@ -950,7 +957,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.86 2003/06/10 12:03:53 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.87 2003/06/11 22:02:25 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/configure.in	Tue Jun 10 12:03:54 2003 +0000
+++ b/configure.in	Wed Jun 11 22:02:26 2003 +0000
@@ -50,7 +50,7 @@
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h)
+AC_CHECK_HEADERS(fcntl.h libutil.h limits.h malloc.h pty.h strings.h sys/ioctl.h sys/time.h unistd.h)
 
 AC_TYPE_MODE_T
 AC_TYPE_PID_T
@@ -261,4 +261,4 @@
 
 AM_GNU_GETTEXT
 
-AC_OUTPUT(Makefile docs/Makefile docs/sample.gftp/Makefile lib/Makefile src/gftp src/Makefile src/gtk/Makefile src/text/Makefile gftp.spec intl/Makefile po/Makefile.in )
+AC_OUTPUT(Makefile docs/Makefile docs/sample.gftp/Makefile lib/Makefile src/gftp src/Makefile src/gtk/Makefile src/text/Makefile gftp.spec intl/Makefile po/Makefile.in  intl/Makefile po/Makefile.in  intl/Makefile po/Makefile.in )
--- a/lib/gftp.h	Tue Jun 10 12:03:54 2003 +0000
+++ b/lib/gftp.h	Wed Jun 11 22:02:26 2003 +0000
@@ -88,8 +88,12 @@
 #define AF_LOCAL AF_UNIX
 #endif
 
-#ifdef HAVE_OPENPTY
+#ifdef HAVE_PTY_H
 #include <pty.h>
+#elif HAVE_LIBUTIL_H
+#include <libutil.h>
+#else
+extern int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize * winp);
 #endif
 
 #ifdef HAVE_GETADDRINFO
--- a/lib/pty.c	Tue Jun 10 12:03:54 2003 +0000
+++ b/lib/pty.c	Wed Jun 11 22:02:26 2003 +0000
@@ -41,9 +41,7 @@
   return (0);
 }
 
-#else /* !__sgi */
-
-#ifdef HAVE_GRANTPT
+#elif HAVE_GRANTPT
 
 int
 open_ptys (gftp_request * request, int *fdm, int *fds)
@@ -85,9 +83,7 @@
   return (0);
 }
 
-#else /* !HAVE_GRANTPT */
-
-#ifdef HAVE_OPENPTY
+#elif HAVE_OPENPTY
 
 int
 open_ptys (gftp_request * request, int *fdm, int *fds)
@@ -142,10 +138,6 @@
   return (GFTP_ERETRYABLE);
 }
 
-#endif /* HAVE_OPENPTY */
-
-#endif /* HAVE_GRANTPT */
-
 #endif /* __sgi */