From 219e273bc935cf4ac26d74fe307ee4197d0d0d44 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Fri, 3 Oct 2008 13:30:15 +0000
Subject: [PATCH] Fix unix-openpty.  The parameters should not include amaster
 and aalave, which are returned by openpty.  This matches the implementation
 in unix.lisp.

---
 code/unix-glibc2.lisp | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/code/unix-glibc2.lisp b/code/unix-glibc2.lisp
index 5c6f21829..5ebe5d2b5 100644
--- a/code/unix-glibc2.lisp
+++ b/code/unix-glibc2.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix-glibc2.lisp,v 1.44 2008/09/24 09:42:31 cshapiro Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix-glibc2.lisp,v 1.45 2008/10/03 13:30:15 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1272,13 +1272,17 @@ length LEN and type TYPE."
 
 ;;; pty.h
 
-(defun unix-openpty (amaster aslave name termp winp)
+(defun unix-openpty (name termp winp)
   "Create pseudo tty master slave pair with NAME and set terminal
    attributes according to TERMP and WINP and return handles for both
    ends in AMASTER and ASLAVE."
-  (int-syscall ("openpty" (* int) (* int) c-string (* (struct termios))
-			  (* (struct winsize)))
-	       amaster aslave name termp winp))
+  (with-alien ((amaster int)
+	       (aslave int))
+    (values
+     (int-syscall ("openpty" (* int) (* int) c-string (* (struct termios))
+			     (* (struct winsize)))
+		  (addr amaster) (addr aslave) name termp winp)
+     amaster aslave)))
 
 #+(or)
 (defun unix-forkpty (amaster name termp winp)
-- 
GitLab