Index: openbsd-compat/bsd-openpty.c
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/openbsd-compat/bsd-openpty.c,v
retrieving revision 1.3
diff -u -r1.3 bsd-openpty.c
--- openbsd-compat/bsd-openpty.c	17 Feb 2004 05:49:55 -0000	1.3
+++ openbsd-compat/bsd-openpty.c	4 May 2004 10:41:57 -0000
@@ -80,24 +80,33 @@
 	char *pts;
 	mysig_t old_signal;
 
-	if ((ptm = open("/dev/ptmx", O_RDWR | O_NOCTTY)) == -1)
+	if ((ptm = open("/dev/ptmx", O_RDWR | O_NOCTTY)) == -1) {
+		debug("open /dev/ptmx failed");
 		return (-1);
+	}
 
 	/* XXX: need to close ptm on error? */
 	old_signal = signal(SIGCHLD, SIG_DFL);
-	if (grantpt(ptm) < 0)
+	if (grantpt(ptm) < 0) {
+		debug("grantpt failed");
 		return (-1);
+	}
 	signal(SIGCHLD, old_signal);
 
-	if (unlockpt(ptm) < 0)
+	if (unlockpt(ptm) < 0) {
+		debug("unlockpt failed");
 		return (-1);
+	}
 
-	if ((pts = ptsname(ptm)) == NULL)
+	if ((pts = ptsname(ptm)) == NULL) {
+		debug("ptsname failed");
 		return (-1);
+	}
 	*amaster = ptm;
 
 	/* Open the slave side. */
 	if ((*aslave = open(pts, O_RDWR | O_NOCTTY)) == -1) {
+		debug("open pty slave %s failed", pts);
 		close(*amaster);
 		return (-1);
 	}
