From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7183 invoked from network); 27 Jun 2000 14:19:12 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 Jun 2000 14:19:12 -0000 Received: (qmail 5833 invoked by alias); 27 Jun 2000 14:18:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12084 Received: (qmail 5820 invoked from network); 27 Jun 2000 14:18:31 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer goliath.siemens.de) From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: PATCH: zpty.c - slave used before set warning Date: Tue, 27 Jun 2000 18:18:21 +0400 Message-ID: <000c01bfe042$8c1b3580$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000D_01BFE064.132CD580" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Importance: Normal This is a multi-part message in MIME format. ------=_NextPart_000_000D_01BFE064.132CD580 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit If fork() fails, newptycmd() could close random descriptor. Pretty rare, I admit, but not improbable. -andrej Have a nice DOS! B >> ------=_NextPart_000_000D_01BFE064.132CD580 Content-Type: application/octet-stream; name="zpty.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="zpty.diff" --- Src/Modules/zpty.c.org Tue Jun 27 18:10:47 2000=0A= +++ Src/Modules/zpty.c Tue Jun 27 18:14:11 2000=0A= @@ -279,7 +279,6 @@=0A= }=0A= if ((pid =3D fork()) =3D=3D -1) {=0A= close(master);=0A= - close(slave);=0A= zwarnnam(nam, "couldn't create pty command: %s", pname, 0);=0A= return 1;=0A= } else if (!pid) {=0A= ------=_NextPart_000_000D_01BFE064.132CD580--