zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: (Fwd) RE: PATCH: 3.1.6-dev-19 + patches: zpty.c SINIX/autopush
Date: Fri, 3 Mar 2000 18:45:15 +0000	[thread overview]
Message-ID: <1000303184515.ZM20937@candle.brasslantern.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]

Andrej sent this to me, but I'm sure it should have gone to the list.

This should be used INSTEAD OF my attempt to fix it, which lost some bits.

--- Forwarded mail from "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>

From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "Bart Schaefer" <schaefer@candle.brasslantern.com>
Subject: RE: PATCH: 3.1.6-dev-19 + patches: zpty.c SINIX/autopush
Date: Fri, 3 Mar 2000 21:06:06 +0300

>
> Malformed patch again, Andrej.  You need a better email client ...
>

It depends upon your definition of "better" :-) But I really want to repeat
once more - once upon a time MIME was invented exactly to solve these
problems ... and your mail bears a MIME-Version header as well :->

Here it is as attachment.

cheers

/andrej


---End of forwarded mail from "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

[-- Attachment #2: zpty.diff --]
[-- Type: application/octet-stream , Size: 1490 bytes --]

--- Src/Modules/zpty.c.org	Fri Mar  3 11:50:37 2000
+++ Src/Modules/zpty.c	Fri Mar  3 18:33:24 2000
@@ -158,7 +158,7 @@
 
 #else /* ! __osf__ */
 
-#if __SVR4
+#if defined(__SVR4) || defined(sinix)
 
 #include <sys/stropts.h>
 
@@ -167,11 +167,12 @@
 {
     int mfd, sfd;
     char *name;
+    int ret;
 
     if ((mfd = open("/dev/ptmx", O_RDWR)) < 0)
 	return 1;
 
-    if (!(name = ptsname(mfd)) || grantpt(mfd) || unlockpt(mfd)) {
+    if (grantpt(mfd) || unlockpt(mfd) || !(name = ptsname(mfd))) {
 	close(mfd);
 	return 1;
     }
@@ -179,20 +180,31 @@
 	close(mfd);
 	return 1;
     }
-    if (ioctl(sfd, I_PUSH, "ptem") ||
-	ioctl(sfd, I_PUSH, "ldterm") ||
-	ioctl(sfd, I_PUSH, "ttcompat")) {
-	close(mfd);
-	close(sfd);
-	return 1;
-    }
+    if ((ret = ioctl(sfd, I_FIND, "ptem")) != 1)
+	if (ret == -1 || ioctl(sfd, I_PUSH, "ptem") == -1) {
+	    close(mfd);
+	    close(sfd);
+	    return 1;
+	}
+    if ((ret = ioctl(sfd, I_FIND, "ldterm")) != 1)
+	if (ret == -1 || ioctl(sfd, I_PUSH, "ldterm") == -1) {
+	    close(mfd);
+	    close(sfd);
+	    return 1;
+	}
+    if ((ret = ioctl(sfd, I_FIND, "ttcompat")) != 1)
+	if (ret == -1 || ioctl(sfd, I_PUSH, "ttcompat") == -1) {
+	    close(mfd);
+	    close(sfd);
+	    return 1;
+	}
     *master = mfd;
     *slave = sfd;
 
     return 0;
 }
 
-#else /* ! __SVR4 */
+#else /* ! (defined(__SVR4) || defined(sinix))  */
 
 static int
 get_pty(int *master, int *slave)

                 reply	other threads:[~2000-03-03 18:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1000303184515.ZM20937@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).