From owner-freebsd-x11@FreeBSD.ORG Tue Oct 11 12:40:11 2011 Return-Path: Delivered-To: freebsd-x11@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BCDD106566B for ; Tue, 11 Oct 2011 12:40:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD508FC14 for ; Tue, 11 Oct 2011 12:40:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p9BCeBvd090415 for ; Tue, 11 Oct 2011 12:40:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p9BCeBID090414; Tue, 11 Oct 2011 12:40:11 GMT (envelope-from gnats) Date: Tue, 11 Oct 2011 12:40:11 GMT Message-Id: <201110111240.p9BCeBID090414@freefall.freebsd.org> To: freebsd-x11@FreeBSD.org From: Ed Schouten Cc: Subject: Re: ports/161480: [patch] x11/luit: don't depend on pty(4), use openpty(3) X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Schouten List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2011 12:40:11 -0000 The following reply was made to PR ports/161480; it has been noted by GNATS. From: Ed Schouten To: bug-followup@FreeBSD.org, nalitoja@gmail.com Cc: bf1783@gmail.com Subject: Re: ports/161480: [patch] x11/luit: don't depend on pty(4), use openpty(3) Date: Tue, 11 Oct 2011 14:32:37 +0200 Hi, I'd rather see something like the attached patch get committed upstream. There's nothing wrong with using grantpt(), it's just the lack of a call to posix_openpt(2). diff --git a/configure.ac b/configure.ac index c3cd947..e9a5984 100644 --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,7 @@ AC_CANONICAL_HOST AC_CHECK_HEADERS([pty.h stropts.h sys/param.h sys/select.h]) -AC_CHECK_FUNCS([select grantpt]) +AC_CHECK_FUNCS([select grantpt posix_openpt]) AC_ARG_WITH(localealiasfile, AS_HELP_STRING([--with-localealiasfile=], diff --git a/sys.c b/sys.c index 804bdbb..8463b05 100644 --- a/sys.c +++ b/sys.c @@ -335,7 +335,11 @@ allocatePty(int *pty_return, char **line_return) #if defined(HAVE_GRANTPT) int rc; +#ifdef HAVE_POSIX_OPENPT + pty = posix_openpt(O_RDWR); +#else pty = open("/dev/ptmx", O_RDWR); +#endif if (pty < 0) goto bsd; Greetings, -- Ed Schouten WWW: http://80386.nl/