summaryrefslogtreecommitdiffstats
path: root/sys/dev/isa/mcd.c
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2011-06-03 18:22:25 +0000
committermatthew <matthew@openbsd.org>2011-06-03 18:22:25 +0000
commita80ef0a151ee0ed6807aa1b70bdd31a5fcde7bdb (patch)
treee9a3b6744eaffbcb7ca06d9e6369b8c9f1a41328 /sys/dev/isa/mcd.c
parentdon't forget to send the initial clock tick (diff)
downloadwireguard-openbsd-a80ef0a151ee0ed6807aa1b70bdd31a5fcde7bdb.tar.xz
wireguard-openbsd-a80ef0a151ee0ed6807aa1b70bdd31a5fcde7bdb.zip
Fix two compile errors in mcd(4) due to bitrot:
1. Need to include <sys/dkio.h> since <sys/ioctl.h> no longer includes it. 2. readdisklabel() returns an int, not an error string, so update mcdgetdisklabel() accordingly. The return value is just ignored currently, but that's no worse than cdgetdisklabel() in cd(4)... Apparently no one has needed mcd(4) in the last two years.
Diffstat (limited to 'sys/dev/isa/mcd.c')
-rw-r--r--sys/dev/isa/mcd.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/dev/isa/mcd.c b/sys/dev/isa/mcd.c
index 2846878d66f..b4012fe2a58 100644
--- a/sys/dev/isa/mcd.c
+++ b/sys/dev/isa/mcd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mcd.c,v 1.56 2010/09/22 01:18:57 matthew Exp $ */
+/* $OpenBSD: mcd.c,v 1.57 2011/06/03 18:22:25 matthew Exp $ */
/* $NetBSD: mcd.c,v 1.60 1998/01/14 12:14:41 drochner Exp $ */
/*
@@ -67,6 +67,7 @@
#include <sys/stat.h>
#include <sys/uio.h>
#include <sys/ioctl.h>
+#include <sys/dkio.h>
#include <sys/mtio.h>
#include <sys/cdio.h>
#include <sys/errno.h>
@@ -218,7 +219,7 @@ struct cfdriver mcd_cd = {
NULL, "mcd", DV_DISK
};
-void mcdgetdisklabel(dev_t, struct mcd_softc *, struct disklabel *, int);
+int mcdgetdisklabel(dev_t, struct mcd_softc *, struct disklabel *, int);
int mcd_get_parms(struct mcd_softc *);
void mcdstrategy(struct buf *);
void mcdstart(struct mcd_softc *);
@@ -725,15 +726,13 @@ mcdioctl(dev, cmd, addr, flag, p)
#endif
}
-void
+int
mcdgetdisklabel(dev, sc, lp, spoofonly)
dev_t dev;
struct mcd_softc *sc;
struct disklabel *lp;
int spoofonly;
{
- char *errstring;
-
bzero(lp, sizeof(struct disklabel));
lp->d_secsize = sc->blksize;
@@ -759,11 +758,7 @@ mcdgetdisklabel(dev, sc, lp, spoofonly)
/*
* Call the generic disklabel extraction routine
*/
- errstring = readdisklabel(DISKLABELDEV(dev), mcdstrategy, lp, spoofonly);
- if (errstring) {
- /*printf("%s: %s\n", sc->sc_dev.dv_xname, errstring);*/
- return;
- }
+ return (readdisklabel(DISKLABELDEV(dev), mcdstrategy, lp, spoofonly));
}
int