Recognize noauto' (and auto', just for symmetry) in fstab.

This commit is contained in:
mycroft 1993-08-03 01:25:52 +00:00
parent 5cc9898c12
commit 85fd4d583d

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint #ifndef lint
/*static char sccsid[] = "from: @(#)mount.c 5.44 (Berkeley) 2/26/91";*/ /*static char sccsid[] = "from: @(#)mount.c 5.44 (Berkeley) 2/26/91";*/
static char rcsid[] = "$Id: mount.c,v 1.4 1993/08/01 18:26:27 mycroft Exp $"; static char rcsid[] = "$Id: mount.c,v 1.5 1993/08/03 01:25:52 mycroft Exp $";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -165,6 +165,8 @@ main(argc, argv, arge)
if (all) { if (all) {
rval = 0; rval = 0;
while (fs = getfsent()) { while (fs = getfsent()) {
if (fs->fs_mntops && getnoauto(fs->fs_mntops))
continue;
if (BADTYPE(fs->fs_type)) if (BADTYPE(fs->fs_type))
continue; continue;
if (badvfsname(fs->fs_vfstype, vfslist)) if (badvfsname(fs->fs_vfstype, vfslist))
@ -460,6 +462,21 @@ usage()
exit(1); exit(1);
} }
getnoauto(options)
char *options;
{
register char *opt;
int noauto = 0;
char optbuf[BUFSIZ];
(void)strcpy(optbuf, options);
for (opt = strtok(optbuf, ","); opt; opt = strtok((char *)NULL, ","))
if (!strcasecmp(opt, "noauto"))
noauto = 1;
else if (!strcasecmp(opt, "auto"))
noauto = 0;
return noauto;
}
getstdopts(options, flagp) getstdopts(options, flagp)
char *options; char *options;
int *flagp; int *flagp;