diff options
| author | martin <martin@NetBSD.org> | 2022-06-11 18:17:00 +0000 |
|---|---|---|
| committer | martin <martin@NetBSD.org> | 2022-06-11 18:17:00 +0000 |
| commit | fd772c84a9578800a61e497c26c9a40c413a286d (patch) | |
| tree | a19a9a0a543632c29d491dc328f5cce7cc1b0c0b /sys/dev | |
| parent | 031fec0a1457033d4ef46b548bfb9308a2222212 (diff) | |
Since rev 1.101 DIOCAWEDGE could return success without filling in the
wedge device name - which is quite confusing for userland.
Always fill the name if we return success.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/dkwedge/dk.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/dkwedge/dk.c b/sys/dev/dkwedge/dk.c index 05a4c5b05fd..97430e76da1 100644 --- a/sys/dev/dkwedge/dk.c +++ b/sys/dev/dkwedge/dk.c @@ -1,4 +1,4 @@ -/* $NetBSD: dk.c,v 1.111 2022/04/23 16:22:23 hannken Exp $ */ +/* $NetBSD: dk.c,v 1.112 2022/06/11 18:17:00 martin Exp $ */ /*- * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.111 2022/04/23 16:22:23 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.112 2022/06/11 18:17:00 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_dkwedge.h" @@ -483,10 +483,6 @@ dkwedge_add(struct dkwedge_info *dkw) return (ENOMEM); } - /* Return the devname to the caller. */ - strlcpy(dkw->dkw_devname, device_xname(sc->sc_dev), - sizeof(dkw->dkw_devname)); - /* * XXX Really ought to make the disk_attach() and the changing * of state to RUNNING atomic. @@ -508,6 +504,10 @@ announce: sc->sc_size, sc->sc_offset, sc->sc_ptype[0] == '\0' ? "<unknown>" : sc->sc_ptype); + /* Return the devname to the caller. */ + strlcpy(dkw->dkw_devname, device_xname(sc->sc_dev), + sizeof(dkw->dkw_devname)); + return (0); } |
