delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/03/01/00:28:11

From: sos AT buggy DOT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: RE: Dup2 fix
1 Mar 1998 00:28:11 -0800 :
Message-ID: <01BD4503.88D9B770.cygnus.cygwin32.developers@sos>
To: "cygwin32-developers AT cygnus DOT com" <cygwin32-developers AT cygnus DOT com>,
"'cgf AT bbc DOT com'" <cgf AT bbc DOT com>

Christopher Faylor wrote:
> <<File: dupfix.gz>>
> I was surprised to find zsh stopped working with the release version of
> B19.  The reason is that it does an fdopen(..., "w+") on a file handle
> that has been duped.
>
> Unfortunately, cygwin didn't preserve the settings file handles across
> a dup.  Apparently fdopen is now checking this more stringently.
>
> 	patch from cgf AT bbc DOT com (Christopher Faylor)
> 	* pipe.cc (dup2): Ensure that an fd's flags are duplicated along
> 	with the fd itself.
>

Chris, your patch looks strange for me... hinfo_vec::dup2() copies all 
flags! A had fdopen() problems with b19 release too, but solved them in a 
different way:

fhandler.cc	(fhandler_base::init): set file access flags corresponding to 
acees 			mode.

net.cc		include fcntl.h
			(fhandler_socket::fhandler_socket): set socket descriptor access flags 
			to O_RDWR.

 
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job

begin 600 fdopen.diff
M9&EF9B M=7 @+W=I;G-U<"]F:&%N9&QE<BYC8R!W:6YS=7 O9FAA;F1L97(N
M8V,*+2TM("]W:6YS=7 O9FAA;F1L97(N8V,)5V5D($9E8B Q,2 P-CHQ-#HU
M-2 Q.3DX"BLK*R!W:6YS=7 O9FAA;F1L97(N8V,)4V%T($9E8B R." Q.#HU
M-3HT-R Q.3DX"D! ("TY,3 L-B K.3$P+#$S($! (&9H86YD;&5R7V)A<V4Z
M.FEN:70@*$A!3D1,12!F+"!I;G0 AT 8FEN+" *(" @<V5T7W=?8FEN87)Y("AB
M:6XI.PH@("!A8V-E<W-?(#T AT 83L*(" @<V5T7VYA;64@*&XI.PHK("!A("8]
M($=%3D5224-?4D5!1"!\($=%3D5224-?5U))5$4["BL@(&EF("AA(#T]($=%
M3D5224-?4D5!1"D**R @("!S971?9FQA9W,@*$]?4D1/3DQ9*3L**R @:68@
M*&$@/3T AT 1T5 DOT 15))0U]74DE412D**R @("!S971?9FQA9W,@*$]?5U)/3DQ9
M*3L**R @:68@*&$@/3T@*$=%3D5224-?4D5!1"!\($=%3D5224-?5U))5$4I
M*0HK(" @('-E=%]F;&%G<R H3U]21%=2*3L*(" @9&5B=6=?<')I;G1F("@B
M8W)E871E9"!N97<@9FAA;F1L97)?8F%S92!F;W(@/"5S/B!W:71H(&AA;F1L
M92 E9%QN(BP@;BP AT 9BD["B!]"B *9&EF9B M=7 @+W=I;G-U<"]N970N8V,@
M=VEN<W5P+VYE="YC8PHM+2T@+W=I;G-U<"]N970N8V,)36]N($9E8B R,R P
M.#HT.#HT," Q.3DX"BLK*R!W:6YS=7 O;F5T+F-C"5-A="!&96(@,C@@,3 AT Z
M,S$Z-3D@,3DY. I 0" M,34L-B K,34L-R! 0"!D971A:6QS+B J+PH@(VEN
M8VQU9&4@(G=I;G-U<"YH(@H@(VEN8VQU9&4@/&YE=&1B+F@^"B C:6YC;'5D
M92 \<WES+W-O8VME="YH/@HK(VEN8VQU9&4@/&9C;G1L+F@^"B C:6YC;'5D
M92 B<F5G:7-T<GDN:"(*( H@(V1E9FEN92!?7TE.4TE$15]#64=724XS,E]?
M"D! ("TW-38L-B K-S4W+#<@0$ @9FAA;F1L97)?<V]C:V5T.CIF:&%N9&QE
M<E]S;V-K970@*'5N<VEG;@H@("!S971?:&%N9&QE("@H2$%.1$Q%*2!S*3L*
M(" @9&5B=6=?<')I;G1F("@B<V]C:V5T(&ED("5D7&XB+"!S*3L*(" @;G5M
M8F5R7V]F7W-O8VME=',K*SL**R @<V5T7V9L86=S("A/7U)$5U(I.PH@?0H@
G"B!F:&%N9&QE<E]S;V-K970Z.GYF:&%N9&QE<E]S;V-K970@*"D*
`
end

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019