Simplify BSD macro tests.

All FreeBSD and NetBSD are BSD >= 199306 and have been for a long time.

MFC after:	1 week
This commit is contained in:
Cy Schubert 2021-02-02 19:18:48 -08:00
parent 8b804ee616
commit e673debe7d
9 changed files with 7 additions and 26 deletions

View File

@ -12,9 +12,6 @@
#include <sys/socket.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#if BSD < 199103
#include <sys/fcntlcom.h>
#endif
#if (__FreeBSD_version >= 300000)
# include <sys/dirent.h>
#else

View File

@ -95,11 +95,7 @@ struct proc *proc;
#endif
#if BSD < 199103
static struct proc *getproc(void);
#else
static struct kinfo_proc *getproc(void);
#endif
int kmemcpy(buf, pos, n)

View File

@ -60,7 +60,7 @@ typedef struct frentry {
struct frentry *fr_grp;
int fr_ref; /* reference count - for grouping */
void *fr_ifa;
#if BSD >= 199306
#ifdef BSD
void *fr_oifa;
#endif
/*
@ -93,7 +93,7 @@ typedef struct frentry {
int (*fr_func)(int, ip_t *, fr_info_t *));
char fr_icode; /* return ICMP code */
char fr_ifname[IFNAMSIZ];
#if BSD > 199306
#ifdef BSD
char fr_oifname[IFNAMSIZ];
#endif
struct frdest fr_tif; /* "to" interface */

View File

@ -131,7 +131,7 @@ main(argc, argv)
if (!debuglevel) {
#if BSD >= 199306
#ifdef BSD
daemon(0, 0);
#else
int fd = open("/dev/null", O_RDWR);

View File

@ -1702,7 +1702,7 @@ int main(argc, argv)
if (make_daemon &&
((config.log != stdout) || (ipmonopts & IPMON_SYSLOG))) {
#if BSD >= 199306
#ifdef BSD
daemon(0, !(ipmonopts & IPMON_SYSLOG));
#else
int pid;

View File

@ -424,12 +424,12 @@ extern mb_t *allocmbt(size_t);
# define USE_QUAD_T
# define U_QUAD_T unsigned long long
# define QUAD_T long long
#else /* BSD > 199306 */
#else /* BSD */
# if !defined(U_QUAD_T)
# define U_QUAD_T u_long
# define QUAD_T long
# endif
#endif /* BSD > 199306 */
#endif /* BSD */
#ifdef USE_INET6

View File

@ -288,14 +288,12 @@ ipfioctl(dev, cmd, data, mode, p)
SPL_INT(s);
CURVNET_SET(TD_TO_VNET(p));
#if (BSD >= 199306)
if (securelevel_ge(p->p_cred, 3) && (mode & FWRITE))
{
V_ipfmain.ipf_interror = 130001;
CURVNET_RESTORE();
return EPERM;
}
#endif
unit = GET_MINOR(dev);
if ((IPL_LOGMAX < unit) || (unit < 0)) {
@ -382,11 +380,9 @@ ipf_send_reset(fin)
}
m->m_len = sizeof(*tcp2) + hlen;
#if (BSD >= 199103)
m->m_data += max_linkhdr;
m->m_pkthdr.len = m->m_len;
m->m_pkthdr.rcvif = (struct ifnet *)0;
#endif
ip = mtod(m, struct ip *);
bzero((char *)ip, hlen);
#ifdef USE_INET6

View File

@ -734,7 +734,7 @@ ipf_log_read(softc, unit, uio)
return EIO;
}
# if (defined(BSD) && (BSD >= 199101)) || defined(__FreeBSD__)
# if defined(BSD)
uio->uio_rw = UIO_READ;
# endif

View File

@ -536,12 +536,8 @@ static int ipfclose(dev, flags
* called during packet processing and cause an inconsistancy to appear in
* the filter lists.
*/
#if (BSD >= 199306)
static int ipfread(dev, uio, ioflag)
int ioflag;
#else
static int ipfread(dev, uio)
#endif
#ifdef __FreeBSD_version
struct cdev *dev;
#else
@ -583,12 +579,8 @@ static int ipfread(dev, uio)
* called during packet processing and cause an inconsistancy to appear in
* the filter lists.
*/
#if (BSD >= 199306)
static int ipfwrite(dev, uio, ioflag)
int ioflag;
#else
static int ipfwrite(dev, uio)
#endif
#ifdef __FreeBSD_version
struct cdev *dev;
#else