summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/cmd/format/auto_sense.c7
-rw-r--r--usr/src/cmd/format/auto_sense.h9
-rw-r--r--usr/src/cmd/format/startup.c18
3 files changed, 16 insertions, 18 deletions
diff --git a/usr/src/cmd/format/auto_sense.c b/usr/src/cmd/format/auto_sense.c
index 2ccd4620a0..5f0f767bef 100644
--- a/usr/src/cmd/format/auto_sense.c
+++ b/usr/src/cmd/format/auto_sense.c
@@ -19,6 +19,8 @@
* CDDL HEADER END
*/
/*
+ * Copyright (c) 2011 Gary Mills
+ *
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -220,9 +222,6 @@ static struct disk_info *find_vbd_disk_info(struct dk_cinfo *dkinfo);
static char *get_sun_disk_name(
char *disk_name,
struct scsi_inquiry *inquiry);
-static char *get_generic_disk_name(
- char *disk_name,
- struct scsi_inquiry *inquiry);
static char *strcopy(
char *dst,
char *src,
@@ -2081,7 +2080,7 @@ get_sun_disk_name(
}
-static char *
+char *
get_generic_disk_name(
char *disk_name,
struct scsi_inquiry *inquiry)
diff --git a/usr/src/cmd/format/auto_sense.h b/usr/src/cmd/format/auto_sense.h
index 31699fab20..163c6344cc 100644
--- a/usr/src/cmd/format/auto_sense.h
+++ b/usr/src/cmd/format/auto_sense.h
@@ -19,6 +19,8 @@
* CDDL HEADER END
*/
/*
+ * Copyright (c) 2011 Gary Mills
+ *
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -26,12 +28,11 @@
#ifndef _AUTO_SENSE_H
#define _AUTO_SENSE_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
+struct scsi_inquiry; /* anonymous struct */
#ifdef __STDC__
/*
@@ -53,12 +54,16 @@ int delete_disk_type(
struct disk_type *disk_type);
struct disk_type *auto_direct_get_geom_label(int fd, struct dk_label *label);
+char *get_generic_disk_name(
+ char *disk_name,
+ struct scsi_inquiry *inquiry);
#else
struct disk_type *auto_sense();
struct disk_type *auto_efi_sense();
int build_default_partition();
struct disk_type *auto_direct_get_geom_label();
+char *get_generic_disk_name();
#endif /* __STDC__ */
diff --git a/usr/src/cmd/format/startup.c b/usr/src/cmd/format/startup.c
index 33d0fd11b5..0396a62997 100644
--- a/usr/src/cmd/format/startup.c
+++ b/usr/src/cmd/format/startup.c
@@ -19,6 +19,8 @@
* CDDL HEADER END
*/
/*
+ * Copyright (c) 2011 Gary Mills
+ *
* Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -1545,23 +1547,15 @@ static void
get_disk_name(int fd, char *disk_name)
{
struct scsi_inquiry inquiry;
- char *p;
if (uscsi_inquiry(fd, (char *)&inquiry, sizeof (inquiry))) {
- err_print("Failed to inquiry this logical disk");
+ if (option_msg)
+ err_print("\nInquiry failed - %s\n", strerror(errno));
+ (void) strcpy(disk_name, "Unknown-Unknown-0001");
return;
}
- p = disk_name;
- (void) memset(p, 0, MAXNAMELEN);
-
- (void) strncpy(p, inquiry.inq_vid, sizeof (inquiry.inq_vid));
- p += sizeof (inquiry.inq_vid) - 1;
- *p++ = '-';
- p = strncpy(p, inquiry.inq_pid, sizeof (inquiry.inq_pid));
- p += sizeof (inquiry.inq_pid) - 1;
- *p++ = '-';
- p = strncpy(p, inquiry.inq_revision, sizeof (inquiry.inq_revision));
+ (void) get_generic_disk_name(disk_name, &inquiry);
}
/*