do not include utmp.h or utmpx.h at all - it is just not needed

This commit is contained in:
Oliver Lehmann 2010-01-18 16:09:40 +00:00
parent 9d5d3b37dc
commit 14ea5c36f8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=248103
3 changed files with 14 additions and 34 deletions

View file

@ -69,7 +69,6 @@ PLIST_SUB+= MYGNOME="@comment "
post-patch: post-patch:
@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g ; \ @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g ; \
s|DATADIRNAME=lib|DATADIRNAME=share|g ; \ s|DATADIRNAME=lib|DATADIRNAME=share|g ; \
s|pty.h|utmpx.h &|g ; \
s|"-lssl |& -lcrypto|' ${WRKSRC}/configure s|"-lssl |& -lcrypto|' ${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|size_t dest_len|size_t *dest_len|g ; \ @${REINPLACE_CMD} -e 's|size_t dest_len|size_t *dest_len|g ; \
s|\(gftp_filename_from_utf8 (gftp_request \* request,\) int force_local,|\1|' \ s|\(gftp_filename_from_utf8 (gftp_request \* request,\) int force_local,|\1|' \

View file

@ -1,12 +0,0 @@
--- config.h.in.orig 2010-01-17 16:28:14.000000000 +0100
+++ config.h.in 2010-01-17 16:28:38.000000000 +0100
@@ -198,6 +198,9 @@
/* Define if the POSIX multithreading library has read/write locks. */
#undef HAVE_PTHREAD_RWLOCK
+/* Define to 1 if you have the <utmpx.h> header file. */
+#undef HAVE_UTMPX_H
+
/* Define to 1 if you have the <pty.h> header file. */
#undef HAVE_PTY_H

View file

@ -1,6 +1,6 @@
--- lib/pty.c.orig Mon Nov 15 18:09:32 2004 --- lib/pty.c.orig 2007-03-13 02:56:43.000000000 +0100
+++ lib/pty.c Mon Nov 15 18:18:21 2004 +++ lib/pty.c 2010-01-17 17:34:25.000000000 +0100
@@ -59,6 +59,57 @@ @@ -59,6 +59,50 @@
return (new_fds); return (new_fds);
} }
@ -8,18 +8,9 @@
+ +
+#ifdef HAVE_PTY_H +#ifdef HAVE_PTY_H
+#include <pty.h> +#include <pty.h>
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#else
+#include <utmp.h> /* for login_tty */ +#include <utmp.h> /* for login_tty */
+#endif
+#elif HAVE_LIBUTIL_H +#elif HAVE_LIBUTIL_H
+#include <libutil.h> +#include <libutil.h>
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#else
+#include <utmp.h> /* for login_tty */
+#endif
+#else +#else
+extern int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize * winp); +extern int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize * winp);
+extern int login_tty(int fd); +extern int login_tty(int fd);
@ -49,21 +40,21 @@
+static int +static int
+_gftp_ptys_open (int fdm, int fds, char *pts_name) +_gftp_ptys_open (int fdm, int fds, char *pts_name)
+{ +{
+ if (login_tty (fds) < 0) + if (login_tty (fds) < 0) {
+ close(fds);
+ return (GFTP_EFATAL); + return (GFTP_EFATAL);
+ }
+ +
+ return (fds); + return (fds);
+} +}
+ +
#elif HAVE_GRANTPT #elif HAVE_GRANTPT
#include <stropts.h> #if !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__))
@@ -123,49 +166,6 @@ @@ -131,49 +192,6 @@
#endif
return (new_fds); return (new_fds);
-} }
-
-#elif HAVE_OPENPTY -#elif HAVE_OPENPTY
- -
-#ifdef HAVE_PTY_H -#ifdef HAVE_PTY_H
@ -105,6 +96,8 @@
- return (GFTP_EFATAL); - return (GFTP_EFATAL);
- -
- return (fds); - return (fds);
} -}
-
#else #else
/* Fall back to *BSD... */