From owner-freebsd-ports Tue Jan 7 23:50:01 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id XAA19677 for ports-outgoing; Tue, 7 Jan 1997 23:50:01 -0800 (PST) Received: from dfw-ix10.ix.netcom.com (dfw-ix10.ix.netcom.com [206.214.98.10]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id XAA19646 for ; Tue, 7 Jan 1997 23:49:58 -0800 (PST) Received: from silvia.HIP.Berkeley.EDU (wck-ca21-12.ix.netcom.com [207.94.231.108]) by dfw-ix10.ix.netcom.com (8.6.13/8.6.12) with ESMTP id XAA21614; Tue, 7 Jan 1997 23:47:27 -0800 Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.8.4/8.6.9) id XAA11117; Tue, 7 Jan 1997 23:47:19 -0800 (PST) Date: Tue, 7 Jan 1997 23:47:19 -0800 (PST) Message-Id: <199701080747.XAA11117@silvia.HIP.Berkeley.EDU> To: m230761@ingenieria.ingsala.unal.edu.co CC: ache@nagual.ru, imp@village.org, ports@freebsd.org In-reply-to: (message from Pedro Giffuni on Tue, 7 Jan 1997 18:34:21 -0500 (EST)) Subject: Re: Niklas Hallqvist: archivers/hpack.non-usa.only From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk * I disagree with this (proposed) way of patching: as clearly stated on "the * porting guidelines", there is a common way to identify BSD4.4, if there are * differences, then we should use the specific *BSD flag, but it doesn't seem * logical to treat everyone as a special case of FreeBSD. Changes in the * diffs will have to be made anyway, but the general idea is that patches * should disappear after we feedback the diffs to the author of the * program. I wouldn't like to define FreeBSD, OpenBSD, and NetBSD because * the port was submitted by someone in another BSD camp. I agree with this in principle. If it can be differentiated by the BSD macro, it should be used instead of __FreeBSD__ and/or __OpenBSD__. By the way, has anyone have a list of changes that can be distinguished by the BSD macro? I haven't been around the sources too long, and I'm sure there will be others there that will appreciate it (we can even put it in the handbook!).... * > Maybe just add -D__FreeBSD__ to OpenBSD CFLAGS in bsd.ports.mk instead and * > handle differences in this way: * > * > #ifdef __FreeBSD__ * > #ifdef __OpenBSD__ * > OpenBSD case * > #else * > FreeBSD case * > #endif * > #endif * > * > As I think OpenBSD will match FreeBSD in 99% cases. I don't think OpenBSD people would like that. ;) And about the patches: * > > ! + #if !defined (__FreeBSD__) && !defined(__OpenBSD__) * > > gets( password ); * > > ! + #else /* gets depricated in FreeBSD && OpenBSD */ * > > + fgets( password, sizeof(password), stdin); * > > + len = strlen(password); * > > + if (password[len - 1] == '\n') gets() is unsafe on all operating systems, I don't see why we should condition this on *BSD.... * > > ! + #if defined (__FreeBSD__) || defined (__OpenBSD__) * > > + found: * > > + #endif No idea on this one. * > > #if defined( BSD386 ) || defined( CONVEX ) || defined( HPUX ) || \ * > > defined( IRIX ) || defined( LINUX ) || defined( POSIX ) || \ * > > ! ! defined( SVR4 ) || defined( UTS4 ) || defined( __FreeBSD__ ) || \ * > > ! ! defined( __OpenBSD__ ) * > > #include Argl. Shouldn't BSD/OS, FreeBSD and OpenBSD all use BSD, or are there systems with non-functional termios.h? * > > #if defined( __UNIX__ ) && !( defined( BSD386 ) || defined( CONVEX ) || \ * > > ! ! defined( NEXT ) || defined( ULTRIX_OLD ) || defined( __FreeBSD__ )) || defined( __OpenBSD__ ) * > > #include /* Needed for mem.functions on some systems */ You've got the parentheses wrong here, or it will include in OpenBSD too (or is it supposed to do that?). * > > #if defined( AIX386 ) || ( defined( __AMIGA__ ) && !defined( LATTICE ) ) || \ * > > defined( __ARC__ ) || defined( __ATARI__ ) || defined( __MSDOS16__ ) || \ * > > ! ! defined( __MSDOS32__ ) || defined( __FreeBSD__ ) || defined( __OpenBSD__ ) * > > #include /* Needed for mem.functions */ This comment contradicts the OpenBSD case above, so I guess it should have been inside the parens. Well, I'm going to quit here. But boy, this code is ugly. Satoshi