Fix a cosmetic problem with some very defensive programming: The devfs
mount would show up as "/dev/", loose that trailing slash.
This commit is contained in:
parent
32565eb8c5
commit
421b0201ed
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72188
@ -284,8 +284,24 @@ main(argc, argv)
|
||||
warning("ignoring excess arguments");
|
||||
|
||||
if (devfs) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We catch or block signals rather than ignore them,
|
||||
|
Loading…
Reference in New Issue
Block a user