aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2001-02-08 22:07:08 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2001-02-08 22:07:08 +0000
commit421b0201edb0f122cdfbd4f5816aebbf092e3034 (patch)
treeaa1ad8c1f26cd32493e87e2a9e555d0295ad4ccc /sbin
parent32565eb8c54a965cac8f570c1e86c1b584d0a4c2 (diff)
Notes
Diffstat (limited to 'sbin')
-rw-r--r--sbin/init/init.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 7498608b388a9..963ef2cfb597c 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -284,7 +284,23 @@ invalid:
warning("ignoring excess arguments");
if (devfs) {
- mount("devfs", _PATH_DEV, 0, 0);
+ char *s;
+ int i;
+
+ /*
+ * Try to avoid the trailing slash in _PATH_DEV.
+ * Be *very* defensive.
+ */
+ s = strdup(_PATH_DEV);
+ if (s != NULL) {
+ i = strlen(s);
+ if (i > 0 && s[i - 1] == '/')
+ s[i - 1] = '\0';
+ mount("devfs", s, 0, 0);
+ free(s);
+ } else {
+ mount("devfs", _PATH_DEV, 0, 0);
+ }
}
/*