Compatibility options for mount(8)

Jeremy Chadwick jdc at koitsu.org
Tue Jul 2 00:07:47 UTC 2013


On Tue, Jul 02, 2013 at 01:11:52AM +0200, Robert Millan wrote:
> Hi,
> 
> On Debian GNU/kFreeBSD, we've been using these bits of glue to make
> FreeBSD mount a bit more compatible with the Linux version of mount.
> 
> We found that this occasionally helps when porting software that needs
> to use those features and relies on Linux semantics:
> 
>   - Ignore "-n" flag, since it requests not to update /etc/mtab, which
> we never do anyway.
> 
>   - Map "-o remount" to its FreeBSD equivalent, "-o update".
> 
> I'd like to check in the attached patch. Please have a look!

Minor but are well-justified given quality of code:

1. Put "n" in alphabetical order/after "l" and not at the end of the
getopt() string, i.e.:

	while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1)

2. Please use strncmp().  I know other parts of the same code use strcmp()
and those should really be improved at some other time, but while you're
already there you might as well use strncmp() (you'll see others have
done the same), i.e.:

			} else if (strncmp(p, "remount", 7) == 0) {

And finally:

3. mount(8) man page should reflect these (IMO).  Attached is the diff
for that; wording based off of some other man pages.

-- 
| Jeremy Chadwick                                   jdc at koitsu.org |
| UNIX Systems Administrator                http://jdc.koitsu.org/ |
| Making life hard for others since 1977.             PGP 4BD6C0CB |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mount.8.diff
Type: text/x-diff
Size: 717 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20130701/a84f868a/attachment.diff>


More information about the freebsd-fs mailing list