diff --git a/sys/dev/ofw/ofdisk.c b/sys/dev/ofw/ofdisk.c index c6b2c6f1203a..b0795e6963e0 100644 --- a/sys/dev/ofw/ofdisk.c +++ b/sys/dev/ofw/ofdisk.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofdisk.c,v 1.53 2019/03/27 19:13:34 martin Exp $ */ +/* $NetBSD: ofdisk.c,v 1.54 2020/01/26 21:43:52 thorpej Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.53 2019/03/27 19:13:34 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.54 2020/01/26 21:43:52 thorpej Exp $"); #include #include @@ -404,11 +404,11 @@ ofdisk_ioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) error = setdisklabel(of->sc_dk.dk_label, lp, /*of->sc_dk.dk_openmask */0, of->sc_dk.dk_cpulabel); - if (error == 0 && cmd == DIOCWDINFO + if (error == 0 && (cmd == DIOCWDINFO #ifdef __HAVE_OLD_DISKLABEL - || xfer == ODIOCWDINFO + || cmd == ODIOCWDINFO #endif - ) + )) error = writedisklabel(MAKEDISKDEV(major(dev), DISKUNIT(dev), RAW_PART), ofdisk_strategy, of->sc_dk.dk_label, of->sc_dk.dk_cpulabel); @@ -422,7 +422,7 @@ ofdisk_ioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) ofdisk_getdefaultlabel(of, (struct disklabel *)data); return 0; #ifdef __HAVE_OLD_DISKLABEL - case DIOCGDEFLABEL: + case ODIOCGDEFLABEL: ofdisk_getdefaultlabel(of, &newlabel); if (newlabel.d_npartitions > OLDMAXPARTITIONS) return ENOTTY;