Fix <scsi.h> breakage. Make patches conform to current standards.

ok naddy@.
This commit is contained in:
krw 2003-09-01 03:08:52 +00:00
parent 18a3125c90
commit 727c9670a8
7 changed files with 197 additions and 346 deletions

View File

@ -0,0 +1,82 @@
$OpenBSD: patch-Makefile,v 1.1 2003/09/01 03:08:52 krw Exp $
--- Makefile.orig 1997-06-10 05:47:39.000000000 -0400
+++ Makefile 2003-08-31 15:29:23.000000000 -0400
@@ -18,9 +18,9 @@ CC = gcc
# SOL2 line.
#
-SOL2 = -DSYSV -DCODEC
-LIBLOC = -R$(LIBDIR)
-EXTRA_LIBS = -lsocket
+#SOL2 = -DSYSV -DCODEC
+#LIBLOC = -R$(LIBDIR)
+#EXTRA_LIBS = -lsocket
#
# Uncomment the following if you want fast database lookups using the
@@ -29,30 +29,30 @@ EXTRA_LIBS = -lsocket
# to match your system type as listed in libdb's PORT directory.
#
-DBCFLAGS = -DLIBDB -Idb.1.85/PORT/include -Idb.1.85/PORT/sunos.5.2
-DBLIB = db.1.85/PORT/sunos.5.2/libdb.a
+#DBCFLAGS = -DLIBDB -Idb.1.85/PORT/include -Idb.1.85/PORT/sunos.5.2
+#DBLIB = db.1.85/PORT/sunos.5.2/libdb.a
#
# Set these to the locations of your XView include files and libraries.
#
-INCDIR = $(OPENWINHOME)/include
-LIBDIR = $(OPENWINHOME)/lib
+INCDIR = /usr/include
+LIBDIR = /usr/X11R6/lib
#
# Set these to the directory names in which to install the software and
# help files.
#
-BINDIR = $(OPENWINHOME)/bin
-HLPDIR = $(OPENWINHOME)/lib/help
+BINDIR = ${PREFIX}/bin
+HLPDIR = ${PREFIX}/lib/help
#
# Set this to the directory containing manual pages. Manual pages will only
# be installed if you "make install.man".
#
-MANDIR = $(OPENWINHOME)/man
+MANDIR = ${PREFIX}/man
#
# Set these to the manual sections (e.g. 1, 4, 5, l) for the program and
@@ -83,7 +83,7 @@ OBJECTS = \
CFLAGS = -g
CPPFLAGS = -I$(INCDIR) $(SOL2)
LDFLAGS = -L$(LIBDIR) $(LIBLOC)
-LDLIBS = -lxview -lolgx -lX11 $(EXTRA_LIBS) $(DBLIB) -ldl
+LDLIBS = -lxview -lolgx -lX11 $(EXTRA_LIBS) $(DBLIB) #-ldl
# Standard targets.
@@ -96,15 +96,14 @@ buildindex: buildindex.c
$(CC) $(LDFLAGS) $(DBCFLAGS) buildindex.c $(DBLIB) -o $@
clean:
- $(RM) $(OBJECTS) *.BAK *.delta core
+ $(RM) $(OBJECTS) *.BAK *.delta *.core workman
-install: $(PROGRAM)
+install: $(PROGRAM) workman.man workmandb.man \
+ $(MANDIR)/man$(PEXT) $(MANDIR)/man$(DEXT)
cp $(PROGRAM) $(BINDIR)
chmod 755 $(BINDIR)/$(PROGRAM)
cp $(PROGRAM).info $(HLPDIR)
chmod 644 $(HLPDIR)/$(PROGRAM).info
-
-install.man: workman.man workmandb.man $(MANDIR)/man$(PEXT) $(MANDIR)/man$(DEXT)
cp workman.man $(MANDIR)/man$(PEXT)/workman.$(PEXT)
chmod 644 $(MANDIR)/man$(PEXT)/workman.$(PEXT)
cp workmandb.man $(MANDIR)/man$(DEXT)/workmandb.$(DEXT)

View File

@ -1,288 +0,0 @@
diff -c --recursive ./Makefile ../workman.new/./Makefile
*** ./Makefile Tue Jun 13 22:37:18 1995
--- ../workman.new/./Makefile Sun Nov 26 03:26:56 1995
***************
*** 18,26 ****
# SOL2 line.
#
! SOL2 = -DSYSV -DCODEC
! LIBLOC = -R$(LIBDIR)
! EXTRA_LIBS = -lsocket
#
# Uncomment the following if you want fast database lookups using the
--- 20,28 ----
# SOL2 line.
#
! #SOL2 = -DSYSV -DCODEC
! #LIBLOC = -R$(LIBDIR)
! #EXTRA_LIBS = -lsocket
#
# Uncomment the following if you want fast database lookups using the
***************
*** 29,58 ****
# to match your system type as listed in libdb's PORT directory.
#
! DBCFLAGS = -DLIBDB -Idb.1.85/PORT/include -Idb.1.85/PORT/sunos.5.2
! DBLIB = db.1.85/PORT/sunos.5.2/libdb.a
#
# Set these to the locations of your XView include files and libraries.
#
! INCDIR = $(OPENWINHOME)/include
! LIBDIR = $(OPENWINHOME)/lib
#
# Set these to the directory names in which to install the software and
# help files.
#
! BINDIR = $(OPENWINHOME)/bin
! HLPDIR = $(OPENWINHOME)/lib/help
#
# Set this to the directory containing manual pages. Manual pages will only
# be installed if you "make install.man".
#
! MANDIR = $(OPENWINHOME)/man
#
# Set these to the manual sections (e.g. 1, 4, 5, l) for the program and
--- 31,60 ----
# to match your system type as listed in libdb's PORT directory.
#
! #DBCFLAGS = -DLIBDB -Idb.1.85/PORT/include -Idb.1.85/PORT/sunos.5.2
! #DBLIB = db.1.85/PORT/sunos.5.2/libdb.a
#
# Set these to the locations of your XView include files and libraries.
#
! INCDIR = /usr/include
! LIBDIR = /usr/X11R6/lib
#
# Set these to the directory names in which to install the software and
# help files.
#
! BINDIR = ${PREFIX}/bin
! HLPDIR = ${PREFIX}/lib/help
#
# Set this to the directory containing manual pages. Manual pages will only
# be installed if you "make install.man".
#
! MANDIR = ${PREFIX}/man
#
# Set these to the manual sections (e.g. 1, 4, 5, l) for the program and
***************
*** 83,89 ****
CFLAGS = -g
CPPFLAGS = -I$(INCDIR) $(SOL2)
LDFLAGS = -L$(LIBDIR) $(LIBLOC)
! LDLIBS = -lxview -lolgx -lX11 $(EXTRA_LIBS) $(DBLIB) -ldl
# Standard targets.
--- 85,91 ----
CFLAGS = -g
CPPFLAGS = -I$(INCDIR) $(SOL2)
LDFLAGS = -L$(LIBDIR) $(LIBLOC)
! LDLIBS = -lxview -lolgx -lX11 $(EXTRA_LIBS) $(DBLIB) #-ldl
# Standard targets.
***************
*** 96,110 ****
$(CC) $(LDFLAGS) $(DBCFLAGS) buildindex.c $(DBLIB) -o $@
clean:
! $(RM) $(OBJECTS) *.BAK *.delta core
! install: $(PROGRAM)
cp $(PROGRAM) $(BINDIR)
chmod 755 $(BINDIR)/$(PROGRAM)
cp $(PROGRAM).info $(HLPDIR)
chmod 644 $(HLPDIR)/$(PROGRAM).info
-
- install.man: workman.man workmandb.man $(MANDIR)/man$(PEXT) $(MANDIR)/man$(DEXT)
cp workman.man $(MANDIR)/man$(PEXT)/workman.$(PEXT)
chmod 644 $(MANDIR)/man$(PEXT)/workman.$(PEXT)
cp workmandb.man $(MANDIR)/man$(DEXT)/workmandb.$(DEXT)
--- 98,111 ----
$(CC) $(LDFLAGS) $(DBCFLAGS) buildindex.c $(DBLIB) -o $@
clean:
! $(RM) $(OBJECTS) *.BAK *.delta *.core workman
! install: $(PROGRAM) workman.man workmandb.man \
! $(MANDIR)/man$(PEXT) $(MANDIR)/man$(DEXT)
cp $(PROGRAM) $(BINDIR)
chmod 755 $(BINDIR)/$(PROGRAM)
cp $(PROGRAM).info $(HLPDIR)
chmod 644 $(HLPDIR)/$(PROGRAM).info
cp workman.man $(MANDIR)/man$(PEXT)/workman.$(PEXT)
chmod 644 $(MANDIR)/man$(PEXT)/workman.$(PEXT)
cp workmandb.man $(MANDIR)/man$(DEXT)/workmandb.$(DEXT)
diff -c --recursive ./plat_freebsd.c ../workman.new/./plat_freebsd.c
*** ./plat_freebsd.c Mon Feb 20 09:29:55 1995
--- ../workman.new/./plat_freebsd.c Sun Nov 26 03:29:22 1995
***************
*** 5,10 ****
--- 5,13 ----
*
* Todd Pfaff, 3/20/94
*
+ * 11/26/95: Modified to work under FreeBSD 2.x
+ * by Donald Burr <d_burr@ix.netcom.com>
+ *
*/
static char *ident = "@(#)plat_freebsd.c 1.2 2/20/95";
***************
*** 30,42 ****
#include "/sys/scsi/scsi_all.h"
#include "/sys/scsi/scsi_cd.h"
#else
#include <scsi/scsi_all.h>
#include <scsi/scsi_cd.h>
#endif
#include "struct.h"
! #define DEFAULT_CD_DEVICE "/dev/rcd0d"
void *malloc();
--- 33,49 ----
#include "/sys/scsi/scsi_all.h"
#include "/sys/scsi/scsi_cd.h"
#else
+ /*
#include <scsi/scsi_all.h>
#include <scsi/scsi_cd.h>
+ */
+ #include <scsi.h>
+ #include <sys/scsiio.h>
#endif
#include "struct.h"
! #define DEFAULT_CD_DEVICE "/dev/rcd0c"
void *malloc();
***************
*** 163,169 ****
}
if (ioctl(d->fd, CDIOCREADSUBCHANNEL, &sc)) {
! #ifdef __NetBSD__
/* we need to release the device so the kernel will notice
reloaded media */
(void) close(d->fd);
--- 170,176 ----
}
if (ioctl(d->fd, CDIOCREADSUBCHANNEL, &sc)) {
! #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
/* we need to release the device so the kernel will notice
reloaded media */
(void) close(d->fd);
***************
*** 261,266 ****
--- 268,276 ----
bzero((char *)&vol, sizeof(vol));
+ #define LEFT_PORT 0
+ #define RIGHT_PORT 1
+
vol.vol[LEFT_PORT] = left;
vol.vol[RIGHT_PORT] = right;
***************
*** 345,356 ****
if (fstatfs(stbuf.st_rdev, &buf) == 0)
return (-3);
! #ifdef __NetBSD__
rval = ioctl(d->fd, CDIOCALLOW);
if (rval == 0)
#endif
rval = ioctl(d->fd, CDIOCEJECT);
! #ifdef __NetBSD__
if (rval == 0)
rval = ioctl(d->fd, CDIOCPREVENT);
#endif
--- 355,366 ----
if (fstatfs(stbuf.st_rdev, &buf) == 0)
return (-3);
! #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
rval = ioctl(d->fd, CDIOCALLOW);
if (rval == 0)
#endif
rval = ioctl(d->fd, CDIOCEJECT);
! #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
if (rval == 0)
rval = ioctl(d->fd, CDIOCPREVENT);
#endif
diff -c --recursive ./workman.man ../workman.new/./workman.man
*** ./workman.man Thu Jun 15 23:52:13 1995
--- ../workman.new/./workman.man Sun Nov 26 03:28:54 1995
***************
*** 151,157 ****
.TP
.I \-p file
Write the program's process ID to a different \fIfile\fP. By default, the
! PID is written to "/tmp/.wm_pid" to allow signals to be sent more easily
(see the SIGNALS section below.)
.TP
.I \-n
--- 151,157 ----
.TP
.I \-p file
Write the program's process ID to a different \fIfile\fP. By default, the
! PID is written to "/var/run/workman.pid" to allow signals to be sent more easily
(see the SIGNALS section below.)
.TP
.I \-n
***************
*** 510,515 ****
--- 510,516 ----
SVR4 port by Baruch Cochavy <bcochavy@iil.intel.com>.
.LP
FreeBSD port by Todd Pfaff <todd@flex.eng.mcmaster.ca>.
+ Modified to work under FreeBSD 2.x by Donald Burr <d_burr@ix.netcom.com>.
.LP
OSF/1 port by R.J. Edwards <rje@escact.ksc.nasa.gov>.
.LP
diff -c --recursive ./workman_stubs.c ../workman.new/./workman_stubs.c
*** ./workman_stubs.c Fri Jun 16 10:44:40 1995
--- ../workman.new/./workman_stubs.c Sun Nov 26 03:26:57 1995
***************
*** 56,62 ****
--- 56,67 ----
Panel_item quitbutton;
char *getenv(), *WMstrdup();
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ /* FreeBSD has a special directory for pidfiles, I guess. */
+ char *pidfile = "/var/run/workman.pid";
+ #else
char *pidfile = "/tmp/.wm_pid";
+ #endif
char * empty = "";
extern char *cd_device;

View File

@ -1,19 +0,0 @@
*** plat_freebsd.c.orig Sun Jun 7 21:25:43 1998
--- plat_freebsd.c Sun Jun 7 21:25:56 1998
***************
*** 11,17 ****
*/
static char *ident = "@(#)plat_freebsd.c 1.2 2/20/95";
! #if defined(__FreeBSD__) || defined(__NetBSD__)
#include <errno.h>
#include <stdio.h>
--- 11,17 ----
*/
static char *ident = "@(#)plat_freebsd.c 1.2 2/20/95";
! #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <errno.h>
#include <stdio.h>

View File

@ -1,39 +0,0 @@
*** plat_freebsd.c.old Fri Aug 7 01:35:19 1998
--- plat_freebsd.c Fri Aug 7 01:41:00 1998
***************
*** 355,368 ****
if (fstatfs(stbuf.st_rdev, &buf) == 0)
return (-3);
! #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
rval = ioctl(d->fd, CDIOCALLOW);
if (rval == 0)
#endif
rval = ioctl(d->fd, CDIOCEJECT);
! #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
if (rval == 0)
rval = ioctl(d->fd, CDIOCPREVENT);
#endif
return rval;
}
--- 355,374 ----
if (fstatfs(stbuf.st_rdev, &buf) == 0)
return (-3);
! #if defined(__NetBSD__) || defined(__FreeBSD__)
rval = ioctl(d->fd, CDIOCALLOW);
if (rval == 0)
#endif
rval = ioctl(d->fd, CDIOCEJECT);
! #if defined(__NetBSD__) || defined(__FreeBSD__)
if (rval == 0)
rval = ioctl(d->fd, CDIOCPREVENT);
+ #endif
+ #if defined(__OpenBSD__)
+ if (rval == 0) {
+ (void) close(d->fd);
+ d->fd = -1;
+ }
#endif
return rval;
}

View File

@ -0,0 +1,79 @@
$OpenBSD: patch-plat_freebsd_c,v 1.1 2003/09/01 03:08:52 krw Exp $
--- plat_freebsd.c.orig 1995-02-20 12:29:55.000000000 -0500
+++ plat_freebsd.c 2003-08-31 15:29:23.000000000 -0400
@@ -5,10 +5,13 @@
*
* Todd Pfaff, 3/20/94
*
+ * 11/26/95: Modified to work under FreeBSD 2.x
+ * by Donald Burr <d_burr@ix.netcom.com>
+ *
*/
static char *ident = "@(#)plat_freebsd.c 1.2 2/20/95";
-#if defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <errno.h>
#include <stdio.h>
@@ -30,13 +33,16 @@ static char *ident = "@(#)plat_freebsd.c
#include "/sys/scsi/scsi_all.h"
#include "/sys/scsi/scsi_cd.h"
#else
+/*
#include <scsi/scsi_all.h>
#include <scsi/scsi_cd.h>
+*/
+#include <sys/scsiio.h>
#endif
#include "struct.h"
-#define DEFAULT_CD_DEVICE "/dev/rcd0d"
+#define DEFAULT_CD_DEVICE "/dev/rcd0c"
void *malloc();
@@ -163,7 +169,7 @@ gen_get_drive_status(d, oldmode, mode, p
}
if (ioctl(d->fd, CDIOCREADSUBCHANNEL, &sc)) {
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
/* we need to release the device so the kernel will notice
reloaded media */
(void) close(d->fd);
@@ -261,6 +267,9 @@ gen_set_volume(d, left, right)
bzero((char *)&vol, sizeof(vol));
+#define LEFT_PORT 0
+#define RIGHT_PORT 1
+
vol.vol[LEFT_PORT] = left;
vol.vol[RIGHT_PORT] = right;
@@ -345,15 +354,21 @@ gen_eject(d)
if (fstatfs(stbuf.st_rdev, &buf) == 0)
return (-3);
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
rval = ioctl(d->fd, CDIOCALLOW);
if (rval == 0)
#endif
rval = ioctl(d->fd, CDIOCEJECT);
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
if (rval == 0)
rval = ioctl(d->fd, CDIOCPREVENT);
#endif
+#if defined(__OpenBSD__)
+ if (rval == 0) {
+ (void) close(d->fd);
+ d->fd = -1;
+ }
+#endif
return rval;
}

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-workman_man,v 1.1 2003/09/01 03:08:52 krw Exp $
--- workman.man.orig 1995-06-16 02:52:13.000000000 -0400
+++ workman.man 2003-08-31 15:29:23.000000000 -0400
@@ -151,7 +151,7 @@ Exit automatically when the CD is ejecte
.TP
.I \-p file
Write the program's process ID to a different \fIfile\fP. By default, the
-PID is written to "/tmp/.wm_pid" to allow signals to be sent more easily
+PID is written to "/var/run/workman.pid" to allow signals to be sent more easily
(see the SIGNALS section below.)
.TP
.I \-n
@@ -510,6 +510,7 @@ BSD/386 port by John T. Kohl <jtk@kolvir
SVR4 port by Baruch Cochavy <bcochavy@iil.intel.com>.
.LP
FreeBSD port by Todd Pfaff <todd@flex.eng.mcmaster.ca>.
+Modified to work under FreeBSD 2.x by Donald Burr <d_burr@ix.netcom.com>.
.LP
OSF/1 port by R.J. Edwards <rje@escact.ksc.nasa.gov>.
.LP

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-workman_stubs_c,v 1.1 2003/09/01 03:08:52 krw Exp $
--- workman_stubs.c.orig 1997-06-11 14:14:01.000000000 -0400
+++ workman_stubs.c 2003-08-31 15:29:23.000000000 -0400
@@ -58,7 +58,12 @@ void show_cdinfo(),
Panel_item quitbutton;
char *getenv(), *WMstrdup();
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+/* FreeBSD has a special directory for pidfiles, I guess. */
+char *pidfile = "/var/run/workman.pid";
+#else
char *pidfile = "/tmp/.wm_pid";
+#endif
char * empty = "";
extern char *cd_device;