From owner-freebsd-current@FreeBSD.ORG Thu Nov 18 17:33:09 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C417E16A4F8 for ; Thu, 18 Nov 2004 17:33:07 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09E5B43D2F for ; Thu, 18 Nov 2004 17:33:07 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])iAIHX5rO029148; Thu, 18 Nov 2004 19:33:05 +0200 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) iAIHX4KW000784; Thu, 18 Nov 2004 19:33:04 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost)iAIHX2is000783; Thu, 18 Nov 2004 19:33:02 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Thu, 18 Nov 2004 19:33:02 +0200 From: Giorgos Keramidas To: Poul-Henning Kamp Message-ID: <20041118173302.GA750@orion.daedalusnetworks.priv> References: <20041118165244.GA46388@orion.daedalusnetworks.priv> <52048.1100797262@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52048.1100797262@critter.freebsd.dk> cc: freebsd-current@freebsd.org Subject: Re: bug of misc/screen and fifos or ours? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2004 17:33:09 -0000 On 2004-11-18 18:01, Poul-Henning Kamp wrote: > In message <20041118165244.GA46388@orion.daedalusnetworks.priv>, Giorgos Kerami > das writes: > >On 2004-11-18 17:47, Poul-Henning Kamp wrote: > >> In message <20041118164356.GA46185@orion.daedalusnetworks.priv>, > >> Giorgos Keramidas writes: > >> > >> > BLOCK fcntl > >> > > >> >This is apparently the result of the following code from screen/socket.c: > >> > > >> > 793 #ifdef NAMEDPIPE > >> > 794 debug("Ha, there was someone knocking on my fifo??\n"); > >> > 795 if (fcntl(ServerSocket, F_SETFL, 0) == -1) > >> > 796 Panic(errno, "BLOCK fcntl"); > >> > 797 #else > >> > > >> >At line 795, screen attempts to set blocking mode on a FIFO and fails. > >> > >> Can you get me the exact errno value ? > > > >Sure. It's ENOTTY. > > Ok, found it, my bug, can you try this patch: Magnificent! Everything works now with fifos too :-) > Index: fs/fifofs/fifo_vnops.c > =================================================================== > RCS file: /home/ncvs/src/sys/fs/fifofs/fifo_vnops.c,v > retrieving revision 1.105 > diff -u -r1.105 fifo_vnops.c > --- fs/fifofs/fifo_vnops.c 17 Nov 2004 07:30:02 -0000 1.105 > +++ fs/fifofs/fifo_vnops.c 18 Nov 2004 16:59:25 -0000 > @@ -566,8 +566,27 @@ > static int > fifo_ioctl_f(struct file *fp, u_long com, void *data, struct ucred *cred, struct thread *td) > { > + struct fifoinfo *fi; > + struct file filetmp; /* Local, so need not be locked. */ > + int error; > > - return (vnops.fo_ioctl(fp, com, data, cred, td)); > + error = ENOTTY; > + fi = fp->f_data; > + if (com == FIONBIO) > + return (0); > + if (fp->f_flag & FREAD) { > + filetmp.f_data = fi->fi_readsock; > + filetmp.f_cred = cred; > + error = soo_ioctl(&filetmp, com, data, cred, td); > + if (error) > + return (error); > + } > + if (fp->f_flag & FWRITE) { > + filetmp.f_data = fi->fi_writesock; > + filetmp.f_cred = cred; > + error = soo_ioctl(&filetmp, com, data, cred, td); > + } > + return (error); > } > > static int