From 57d50fa24d456bafc4e3444b11d2844050f07a84 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Fri, 23 Nov 2007 14:45:00 +0000 Subject: if we cant fetch the serial then fill it with "(unknown)". --- sys/scsi/sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys') 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); } -- cgit v1.2.3