4970862 update_drv of uninstalled driver leaves false entry in /etc/driver_aliases
--- a/usr/src/cmd/modload/update_drv.c Tue Sep 20 14:47:43 2005 -0700
+++ b/usr/src/cmd/modload/update_drv.c Tue Sep 20 14:52:33 2005 -0700
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -284,6 +284,21 @@
}
if (i_flag) {
+ found = get_major_no(driver_name, name_to_major);
+ if (found == ERROR) {
+ (void) fprintf(stderr, gettext(ERR_MAX_MAJOR),
+ name_to_major);
+ err_exit();
+ }
+
+ if (found == UNIQUE) {
+ (void) fprintf(stderr,
+ gettext(ERR_NOT_INSTALLED), driver_name);
+ err_exit();
+ }
+
+ major_num = (major_t)found;
+
/* check if the alias is unique */
if ((error = aliases_unique(aliases)) == ERROR) {
exit_unlock();
@@ -299,21 +314,6 @@
return (error);
}
- found = get_major_no(driver_name, name_to_major);
- if (found == ERROR) {
- (void) fprintf(stderr, gettext(ERR_MAX_MAJOR),
- name_to_major);
- err_exit();
- }
-
- if (found == UNIQUE) {
- (void) fprintf(stderr,
- gettext(ERR_NOT_INSTALLED), driver_name);
- err_exit();
- }
-
- major_num = (major_t)found;
-
/* paranoia - if we crash whilst configuring */
sync();