Fix build on NetBSD. Add QNX support based on patch from Sean Boudreau.

This commit is contained in:
joerg 2007-09-06 20:10:22 +00:00
parent 251295c87f
commit 70e41a9263
3 changed files with 16 additions and 11 deletions

View file

@ -1,4 +1,4 @@
/* $NetBSD: ar_io.c,v 1.10 2007/03/08 17:18:18 rillig Exp $ */ /* $NetBSD: ar_io.c,v 1.11 2007/09/06 20:10:22 joerg Exp $ */
/*- /*-
* Copyright (c) 1992 Keith Muller. * Copyright (c) 1992 Keith Muller.
@ -48,7 +48,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94"; static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
#else #else
__RCSID("$NetBSD: ar_io.c,v 1.10 2007/03/08 17:18:18 rillig Exp $"); __RCSID("$NetBSD: ar_io.c,v 1.11 2007/09/06 20:10:22 joerg Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -67,12 +67,11 @@ __RCSID("$NetBSD: ar_io.c,v 1.10 2007/03/08 17:18:18 rillig Exp $");
#if HAVE_SYS_IOCTL_H #if HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#if HAVE_SYS_TAPE_H
#include <sys/tape.h>
#include "tape_h_fixup.h"
#endif
#if HAVE_SYS_MTIO_H #if HAVE_SYS_MTIO_H
#include <sys/mtio.h> #include <sys/mtio.h>
#elif HAVE_SYS_TAPE_H
#include <sys/tape.h>
#include "tape_h_fixup.h"
#endif #endif
#if HAVE_SYS_WAIT_H #if HAVE_SYS_WAIT_H
#include <sys/wait.h> #include <sys/wait.h>

View file

@ -1,4 +1,4 @@
/* $NetBSD: pack_dev.c,v 1.2 2004/08/21 03:28:56 jlam Exp $ */ /* $NetBSD: pack_dev.c,v 1.3 2007/09/06 20:10:22 joerg Exp $ */
/*- /*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@ -48,7 +48,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#endif #endif
#if !defined(lint) #if !defined(lint)
__RCSID("$NetBSD: pack_dev.c,v 1.2 2004/08/21 03:28:56 jlam Exp $"); __RCSID("$NetBSD: pack_dev.c,v 1.3 2007/09/06 20:10:22 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#if HAVE_SYS_TYPES_H #if HAVE_SYS_TYPES_H
@ -75,6 +75,7 @@ __RCSID("$NetBSD: pack_dev.c,v 1.2 2004/08/21 03:28:56 jlam Exp $");
#endif #endif
#include "pack_dev.h" #include "pack_dev.h"
#include "pax.h"
static pack_t pack_netbsd; static pack_t pack_netbsd;
static pack_t pack_freebsd; static pack_t pack_freebsd;
@ -96,7 +97,7 @@ pack_native(int n, u_long numbers[], const char **error)
portdev_t dev = 0; portdev_t dev = 0;
if (n == 2) { if (n == 2) {
dev = makedev(numbers[0], numbers[1]); dev = TODEV(numbers[0], numbers[1]);
if (major(dev) != numbers[0]) if (major(dev) != numbers[0])
*error = iMajorError; *error = iMajorError;
else if (minor(dev) != numbers[1]) else if (minor(dev) != numbers[1])

View file

@ -1,4 +1,4 @@
/* $NetBSD: pax.h,v 1.10 2006/09/03 12:13:13 obache Exp $ */ /* $NetBSD: pax.h,v 1.11 2007/09/06 20:10:22 joerg Exp $ */
/*- /*-
* Copyright (c) 1992 Keith Muller. * Copyright (c) 1992 Keith Muller.
@ -253,7 +253,12 @@ typedef struct oplist {
#else #else
# define MAJOR(x) major(x) # define MAJOR(x) major(x)
# define MINOR(x) minor(x) # define MINOR(x) minor(x)
# define TODEV(x, y) makedev((x), (y)) # ifdef __QNXNTO__
# include <sys/netmgr.h>
# define TODEV(x, y) makedev(ND_LOCAL_NODE, (x), (y))
# else
# define TODEV(x, y) makedev((x), (y))
# endif
#endif #endif
/* /*