summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2007-11-23 14:44:59 +0000
committerdlg <dlg@openbsd.org>2007-11-23 14:44:59 +0000
commit64c01044e9c8eae116f1fc9f59a95aeabea706e9 (patch)
treed2b04308f3c4959d0365d6639c3bad03aa60a688 /sys
parentkprintf -> printf, unbreaks USB_DEBUG (diff)
downloadwireguard-openbsd-64c01044e9c8eae116f1fc9f59a95aeabea706e9.tar.xz
wireguard-openbsd-64c01044e9c8eae116f1fc9f59a95aeabea706e9.zip
if we cant fetch the serial then fill it with "(unknown)".
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/sd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 780b801fdc5..5337ed16285 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.139 2007/11/11 16:46:51 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.140 2007/11/23 14:44:59 dlg Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -981,6 +981,8 @@ sd_ioctl_inquiry(struct sd_softc *sd, struct dk_inquiry *di)
if (scsi_inquire_vpd(sd->sc_link, &vpd, sizeof(vpd),
SI_PG_SERIAL, 0) == 0)
scsi_strvis(di->serial, vpd.serial, sizeof(vpd.serial));
+ else
+ strlcpy(di->serial, "(unknown)", sizeof(vpd.serial));
return (0);
}