Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 1997 23:47:19 -0800 (PST)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        m230761@ingenieria.ingsala.unal.edu.co
Cc:        ache@nagual.ru, imp@village.org, ports@freebsd.org
Subject:   Re: Niklas Hallqvist: archivers/hpack.non-usa.only
Message-ID:  <199701080747.XAA11117@silvia.HIP.Berkeley.EDU>
In-Reply-To: <Pine.SOL.3.91.970107181336.1376A-100000@ingenieria.ingsala.unal.edu.co> (message from Pedro Giffuni on Tue, 7 Jan 1997 18:34:21 -0500 (EST))

next in thread | previous in thread | raw e-mail | index | archive | help
 * 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 <termios.h>

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 <malloc.h>				/* Needed for mem.functions on some systems */

You've got the parentheses wrong here, or it will include <malloc.h>
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 <stdlib.h>				/* 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701080747.XAA11117>