changeset 10047:8e9d94399508 onnv_119

6841218 incorrectly generated filename in kobj_open_path leads to needless errors in kobj_open_file
author Pramod Batni <Pramod.Batni@Sun.COM>
date Mon, 06 Jul 2009 21:02:28 -0700
parents a9144b04f02d
children 1eb2b3160451
files usr/src/uts/common/krtld/kobj.c usr/src/uts/sun4/os/mlsetup.c
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/krtld/kobj.c	Tue Jul 07 11:15:24 2009 +0800
+++ b/usr/src/uts/common/krtld/kobj.c	Mon Jul 06 21:02:28 2009 -0700
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -3485,9 +3485,11 @@
 			kobj_free(fullname, maxpathlen);
 			return (file);
 		}
+		while (*pathp == ' ')
+			pathp++;
 		if (*pathp == 0)
 			break;
-		pathp++;
+
 	}
 	kobj_free(fullname, maxpathlen);
 	if (_moddebug & MODDEBUG_ERRMSG) {
--- a/usr/src/uts/sun4/os/mlsetup.c	Tue Jul 07 11:15:24 2009 +0800
+++ b/usr/src/uts/sun4/os/mlsetup.c	Mon Jul 06 21:02:28 2009 -0700
@@ -512,11 +512,11 @@
 	 */
 	(void) strcpy(path, "/platform/");
 	(void) strcat(path, platname);
-	(void) strcat(path, "/kernel ");
+	(void) strcat(path, "/kernel");
 	if (!compat) {
-		(void) strcat(path, "/platform/");
+		(void) strcat(path, " /platform/");
 		(void) strcat(path, defname);
-		(void) strcat(path, "/kernel ");
+		(void) strcat(path, "/kernel");
 	}
 	return;