Date: Wed, 22 Aug 2001 02:20:01 -0700 (PDT) From: Peter Pentchev <roam@ringlet.net> To: freebsd-ports@FreeBSD.org Subject: Re: ports/29934: [PATCH] scsh fails to compile Message-ID: <200108220920.f7M9K1n18646@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/29934; it has been noted by GNATS. From: Peter Pentchev <roam@ringlet.net> To: Evan Sarmiento <kaworu@sektor7.ath.cx> Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: ports/29934: [PATCH] scsh fails to compile Date: Wed, 22 Aug 2001 12:12:00 +0300 On Tue, Aug 21, 2001 at 02:32:30PM -0700, Evan Sarmiento wrote: > > >Number: 29934 > >Category: ports > >Synopsis: [PATCH] scsh fails to compile > >Originator: Evan Sarmiento > >Release: 5.0 > >Organization: > >Environment: > FreeBSD teqnix.sekt7.org 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Sun Aug 19 08:53:54 EDT 2001 kaworu@teqnix.sekt7.org:/usr/src/sys/compile/TEQNIX i386 > >Description: > When compiling, gcc complains because fileno(fs) = fd should be fd = fileno(fs) I don't think this is correct. The name of the function is 'setfileno()', which seems to imply that the function really wants to change the fileno of the FILE structure - that is, it wants to tweak the FILE structure internals. The patch you are proposing would break the function's semantics - the function would turn out to be a no-op, not changing the FILE structure in any way. A more correct patch would be to change the application so that it does not fumble inside the FILE structure. I don't really see ANY reason that an app would want to change a FILE structure's file descriptor *within the structure*, keeping all other fields in some inconsistent state referring to the *old* file descriptor, instead of simply calling the well-documented and standardized fdopen() stdio function. Unfortunately, I do not have the time to look at the scsh sources right now, so I cannot see what would the correct fix be. However, it is most certainly NOT correct for scsh to muck the FILE structure internals - you are most probably seeing a problem because in -current, the FILE internals were changed in a way that kept stdio completely standards-compliant, made it somewhat more efficient, esp. WRT threads, and as a side effect exposed such "smart" programs trying to poke their fingers where they can only get burnt. G'luck, Peter -- This sentence contains exactly threee erors. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108220920.f7M9K1n18646>