1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Enable bug-for-bug compatibility with mount_mfs when the program

name is "mount_mfs" or "mfs". Previously, the condition was that
the program name must start with "mount_", but this both missed
the case where mount(8) invokes mdmfs with argv[0] = "mfs", and it
included cases such as "mount_md" where compatibility is not
required.

Reviewed by:	dd
This commit is contained in:
Ian Dowse 2001-09-30 15:14:16 +00:00
parent 47f07d95ba
commit 2dc4ac06ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84167
2 changed files with 7 additions and 5 deletions

View File

@ -304,9 +304,10 @@ Full compatibility is enabled with the
flag,
or by starting
.Nm
with
.Li mount_
at the beginning of its name
with the name
.Li mount_mfs
or
.Li mfs
(as returned by
.Xr getprogname 3 ) .
In this mode, only the options which would be accepted by

View File

@ -116,8 +116,9 @@ main(int argc, char **argv)
newfs_arg = strdup("");
mount_arg = strdup("");
/* If we were started as mount_*, imply -C. */
if (strncmp(getprogname(), "mount_", 6) == 0)
/* If we were started as mount_mfs or mfs, imply -C. */
if (strcmp(getprogname(), "mount_mfs") == 0 ||
strcmp(getprogname(), "mfs") == 0)
compat = true;
while ((ch = getopt(argc, argv,