summaryrefslogtreecommitdiff
path: root/usr/src/cmd/allocate/mkdevalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/allocate/mkdevalloc.c')
-rw-r--r--usr/src/cmd/allocate/mkdevalloc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr/src/cmd/allocate/mkdevalloc.c b/usr/src/cmd/allocate/mkdevalloc.c
index 750b1eeb9a..508f5961c4 100644
--- a/usr/src/cmd/allocate/mkdevalloc.c
+++ b/usr/src/cmd/allocate/mkdevalloc.c
@@ -20,12 +20,10 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* scan /dev directory for mountable objects and construct device_allocate
* file for allocate....
@@ -94,7 +92,7 @@ struct tape {
#define DFLT_NTAPE 10 /* size of initial array */
#define SIZE_OF_RST 3 /* |rmt| */
#define SIZE_OF_NRST 4 /* |nrmt| */
-#define SIZE_OF_TMP 4 /* |/tmp| */
+#define SIZE_OF_TMP 4 /* |/tmp| */
#define SIZE_OF_RMT 8 /* |/dev/rmt| */
#define TAPE_CLEAN SECLIB"/st_clean"
@@ -909,7 +907,7 @@ docd()
continue;
/* get device # (disk #) */
- if (sscanf(dep->d_name, "c%dt%d", &ctrl, &id) <= 0)
+ if (sscanf(dep->d_name, "c%dt%d", &ctrl, &id) != 2)
continue;
/* see if this is one of the cd special devices */
@@ -1117,7 +1115,7 @@ dormdisk(int cd_count)
continue;
/* get device # (disk #) */
- if (sscanf(dep->d_name, "c%dt%d", &ctrl, &id) <= 0)
+ if (sscanf(dep->d_name, "c%dt%d", &ctrl, &id) != 2)
continue;
/* see if we've already examined this device */
@@ -1165,6 +1163,9 @@ dormdisk(int cd_count)
/* will exit(1) if insufficient memory */
nrmdisk = expandmem(i, (void **)&rmdisk,
sizeof (struct rmdisk));
+ /* When we expand rmdisk, need to expand rmdisk_r */
+ (void) expandmem(i, (void **)&rmdisk_r,
+ sizeof (struct rmdisk));
}
nm = (char *)malloc(SIZE_OF_DSK + 1 + strlen(dep->d_name) + 1);
if (nm == NULL)