mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Remove unused #includes. Spelling. Add rcsid. Do not dot terminate err()
strings.
This commit is contained in:
parent
6b5bcce5dc
commit
bcb1d8469d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37425
|
@ -70,8 +70,8 @@ has the following format:
|
|||
.Bd -literal
|
||||
struct mntopt {
|
||||
char *m_option; /* option name */
|
||||
int m_inverse; /* is this a negative option, eg "dev" */
|
||||
int m_flag; /* bit to set, eg MNT_RDONLY */
|
||||
int m_inverse; /* is this a negative option, e.g. "dev" */
|
||||
int m_flag; /* bit to set, e.g. MNT_RDONLY */
|
||||
int m_altloc; /* non-zero to use altflagp rather than flagp */
|
||||
};
|
||||
.Ed
|
||||
|
|
|
@ -36,20 +36,16 @@
|
|||
static char sccsid[] = "@(#)getmntopts.c 8.3 (Berkeley) 3/29/95";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: getmntopts.c,v 1.6 1997/08/24 21:02:47 steve Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fstab.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "extern.h"
|
||||
#include "mntopts.h"
|
||||
|
||||
int getmnt_silent = 0;
|
||||
|
@ -96,7 +92,7 @@ getmntopts(options, m0, flagp, altflagp)
|
|||
break;
|
||||
}
|
||||
|
||||
/* Save flag, or fail if option is not recognised. */
|
||||
/* Save flag, or fail if option is not recognized. */
|
||||
if (m->m_option) {
|
||||
thisflagp = m->m_altloc ? altflagp : flagp;
|
||||
if (negative == m->m_inverse)
|
||||
|
|
|
@ -31,13 +31,13 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mntopts.h 8.7 (Berkeley) 3/29/95
|
||||
* $Id: mntopts.h,v 1.12 1997/11/13 00:28:48 julian Exp $
|
||||
* $Id: mntopts.h,v 1.13 1998/04/08 18:31:17 wosch Exp $
|
||||
*/
|
||||
|
||||
struct mntopt {
|
||||
const char *m_option; /* option name */
|
||||
int m_inverse; /* if a negative option, eg "dev" */
|
||||
int m_flag; /* bit to set, eg. MNT_RDONLY */
|
||||
int m_inverse; /* if a negative option, e.g. "dev" */
|
||||
int m_flag; /* bit to set, e.g. MNT_RDONLY */
|
||||
int m_altloc; /* 1 => set bit in altflags */
|
||||
};
|
||||
|
||||
|
|
|
@ -40,10 +40,9 @@ static const char copyright[] =
|
|||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id: mount.c,v 1.26 1998/05/17 21:57:17 dt Exp $";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -79,7 +78,7 @@ void prmount __P((struct statfs *));
|
|||
void putfsent __P((const struct statfs *));
|
||||
void usage __P((void));
|
||||
|
||||
/* Map from mount otions to printable formats. */
|
||||
/* Map from mount options to printable formats. */
|
||||
static struct opt {
|
||||
int o_opt;
|
||||
const char *o_name;
|
||||
|
@ -155,7 +154,7 @@ main(argc, argv)
|
|||
break;
|
||||
case 't':
|
||||
if (vfslist != NULL)
|
||||
errx(1, "only one -t option may be specified.");
|
||||
errx(1, "only one -t option may be specified");
|
||||
vfslist = makevfslist(optarg);
|
||||
vfstype = optarg;
|
||||
break;
|
||||
|
@ -222,7 +221,7 @@ main(argc, argv)
|
|||
if (init_flags & MNT_UPDATE) {
|
||||
if ((mntbuf = getmntpt(*argv)) == NULL)
|
||||
errx(1,
|
||||
"unknown special file or file system %s.",
|
||||
"unknown special file or file system %s",
|
||||
*argv);
|
||||
if ((fs = getfsfile(mntbuf->f_mntonname)) != NULL)
|
||||
mntfromname = fs->fs_spec;
|
||||
|
@ -234,10 +233,10 @@ main(argc, argv)
|
|||
}
|
||||
if ((fs = getfsfile(*argv)) == NULL &&
|
||||
(fs = getfsspec(*argv)) == NULL)
|
||||
errx(1, "%s: unknown special file or file system.",
|
||||
errx(1, "%s: unknown special file or file system",
|
||||
*argv);
|
||||
if (BADTYPE(fs->fs_type))
|
||||
errx(1, "%s has unknown file system type.",
|
||||
errx(1, "%s has unknown file system type",
|
||||
*argv);
|
||||
rval = mountfs(fs->fs_vfstype, fs->fs_spec, fs->fs_file,
|
||||
init_flags, options, fs->fs_mntops);
|
||||
|
@ -355,7 +354,7 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
|||
|
||||
if (realpath(name, mntpath) != NULL && stat(mntpath, &sb) == 0) {
|
||||
if (!S_ISDIR(sb.st_mode)) {
|
||||
warnx("%s: Not a directory", mntpath);
|
||||
warnx("%s: not a directory", mntpath);
|
||||
return (1);
|
||||
}
|
||||
} else {
|
||||
|
@ -386,7 +385,7 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
|||
/*
|
||||
* XXX
|
||||
* The mount_mfs (newfs) command uses -o to select the
|
||||
* optimisation mode. We don't pass the default "-o rw"
|
||||
* optimization mode. We don't pass the default "-o rw"
|
||||
* for that reason.
|
||||
*/
|
||||
if (flags & MNT_UPDATE)
|
||||
|
@ -427,10 +426,8 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
|||
char *cp;
|
||||
for (edir = edirs; *edir; edir++)
|
||||
len += strlen(*edir) + 2; /* ", " */
|
||||
if ((cp = malloc(len)) == NULL) {
|
||||
warn(NULL);
|
||||
exit(1);
|
||||
}
|
||||
if ((cp = malloc(len)) == NULL)
|
||||
errx(1, "malloc failed");
|
||||
cp[0] = '\0';
|
||||
for (edir = edirs; *edir; edir++) {
|
||||
strcat(cp, *edir);
|
||||
|
@ -529,7 +526,7 @@ catopt(s0, s1)
|
|||
if (s0 && *s0) {
|
||||
i = strlen(s0) + strlen(s1) + 1 + 1;
|
||||
if ((cp = malloc(i)) == NULL)
|
||||
err(1, NULL);
|
||||
errx(1, "malloc failed");
|
||||
(void)snprintf(cp, i, "%s,%s", s0, s1);
|
||||
} else
|
||||
cp = strdup(s1);
|
||||
|
@ -570,12 +567,10 @@ void
|
|||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"usage: mount %s %s\n mount %s\n mount %s\n",
|
||||
"[-dfpruvw] [-o options] [-t ufs | external_type]",
|
||||
"special node",
|
||||
"[-adfpruvw] [-t ufs | external_type]",
|
||||
"[-dfpruvw] special | node");
|
||||
(void)fprintf(stderr, "%s\n%s\n%s\n",
|
||||
"usage: mount [-dfpruvw] [-o options] [-t ufs | external_type] special node",
|
||||
" mount [-adfpruvw] [-t ufs | external_type]",
|
||||
" mount [-dfpruvw] special | node");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,10 +40,9 @@ static const char copyright[] =
|
|||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mount_ufs.c 8.4 (Berkeley) 4/26/95";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id: mount_ufs.c,v 1.12 1998/03/08 19:03:05 steve Exp $";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -52,8 +51,6 @@ static const char rcsid[] =
|
|||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <ufs/ufs/ufsmount.h>
|
||||
|
@ -132,7 +129,7 @@ mount_ufs(argc, argv)
|
|||
result = -1;
|
||||
/*
|
||||
* If we are mounting root, and we have a mount of something that
|
||||
* might be the compatability slice, try mounting other slices
|
||||
* might be the compatibility slice, try mounting other slices
|
||||
* first. If the kernel has done the right thing and mounted
|
||||
* the slice because the disk is really sliced, this will find
|
||||
* the real root filesystem. If not, we'll try what was supplied.
|
||||
|
@ -158,21 +155,22 @@ mount_ufs(argc, argv)
|
|||
#else
|
||||
if (mount(vfc.vfc_name, fs_name, mntflags, &args) < 0) {
|
||||
#endif
|
||||
(void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name);
|
||||
switch (errno) {
|
||||
case EMFILE:
|
||||
(void)fprintf(stderr, "mount table full.\n");
|
||||
warnx("%s on %s: mount table full",
|
||||
args.fspec, fs_name);
|
||||
break;
|
||||
case EINVAL:
|
||||
if (mntflags & MNT_UPDATE)
|
||||
(void)fprintf(stderr,
|
||||
"Specified device does not match mounted device.\n");
|
||||
warnx(
|
||||
"%s on %s: specified device does not match mounted device",
|
||||
args.fspec, fs_name);
|
||||
else
|
||||
(void)fprintf(stderr,
|
||||
"Incorrect super block.\n");
|
||||
warnx("%s on %s: incorrect super block",
|
||||
args.fspec, fs_name);
|
||||
break;
|
||||
default:
|
||||
(void)fprintf(stderr, "%s\n", strerror(errno));
|
||||
warn(NULL);
|
||||
break;
|
||||
}
|
||||
return (1);
|
||||
|
|
|
@ -34,16 +34,14 @@
|
|||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)vfslist.c 8.1 (Berkeley) 5/8/95";
|
||||
#else
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
|
@ -83,7 +81,7 @@ makevfslist(fslist)
|
|||
if (*nextcp == ',')
|
||||
i++;
|
||||
if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) {
|
||||
warn(NULL);
|
||||
warnx("malloc failed");
|
||||
return (NULL);
|
||||
}
|
||||
nextcp = fslist;
|
||||
|
|
|
@ -70,8 +70,8 @@ has the following format:
|
|||
.Bd -literal
|
||||
struct mntopt {
|
||||
char *m_option; /* option name */
|
||||
int m_inverse; /* is this a negative option, eg "dev" */
|
||||
int m_flag; /* bit to set, eg MNT_RDONLY */
|
||||
int m_inverse; /* is this a negative option, e.g. "dev" */
|
||||
int m_flag; /* bit to set, e.g. MNT_RDONLY */
|
||||
int m_altloc; /* non-zero to use altflagp rather than flagp */
|
||||
};
|
||||
.Ed
|
||||
|
|
|
@ -36,20 +36,16 @@
|
|||
static char sccsid[] = "@(#)getmntopts.c 8.3 (Berkeley) 3/29/95";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: getmntopts.c,v 1.6 1997/08/24 21:02:47 steve Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fstab.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "extern.h"
|
||||
#include "mntopts.h"
|
||||
|
||||
int getmnt_silent = 0;
|
||||
|
@ -96,7 +92,7 @@ getmntopts(options, m0, flagp, altflagp)
|
|||
break;
|
||||
}
|
||||
|
||||
/* Save flag, or fail if option is not recognised. */
|
||||
/* Save flag, or fail if option is not recognized. */
|
||||
if (m->m_option) {
|
||||
thisflagp = m->m_altloc ? altflagp : flagp;
|
||||
if (negative == m->m_inverse)
|
||||
|
|
|
@ -31,13 +31,13 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mntopts.h 8.7 (Berkeley) 3/29/95
|
||||
* $Id: mntopts.h,v 1.12 1997/11/13 00:28:48 julian Exp $
|
||||
* $Id: mntopts.h,v 1.13 1998/04/08 18:31:17 wosch Exp $
|
||||
*/
|
||||
|
||||
struct mntopt {
|
||||
const char *m_option; /* option name */
|
||||
int m_inverse; /* if a negative option, eg "dev" */
|
||||
int m_flag; /* bit to set, eg. MNT_RDONLY */
|
||||
int m_inverse; /* if a negative option, e.g. "dev" */
|
||||
int m_flag; /* bit to set, e.g. MNT_RDONLY */
|
||||
int m_altloc; /* 1 => set bit in altflags */
|
||||
};
|
||||
|
||||
|
|
|
@ -40,10 +40,9 @@ static const char copyright[] =
|
|||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id: mount.c,v 1.26 1998/05/17 21:57:17 dt Exp $";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -79,7 +78,7 @@ void prmount __P((struct statfs *));
|
|||
void putfsent __P((const struct statfs *));
|
||||
void usage __P((void));
|
||||
|
||||
/* Map from mount otions to printable formats. */
|
||||
/* Map from mount options to printable formats. */
|
||||
static struct opt {
|
||||
int o_opt;
|
||||
const char *o_name;
|
||||
|
@ -155,7 +154,7 @@ main(argc, argv)
|
|||
break;
|
||||
case 't':
|
||||
if (vfslist != NULL)
|
||||
errx(1, "only one -t option may be specified.");
|
||||
errx(1, "only one -t option may be specified");
|
||||
vfslist = makevfslist(optarg);
|
||||
vfstype = optarg;
|
||||
break;
|
||||
|
@ -222,7 +221,7 @@ main(argc, argv)
|
|||
if (init_flags & MNT_UPDATE) {
|
||||
if ((mntbuf = getmntpt(*argv)) == NULL)
|
||||
errx(1,
|
||||
"unknown special file or file system %s.",
|
||||
"unknown special file or file system %s",
|
||||
*argv);
|
||||
if ((fs = getfsfile(mntbuf->f_mntonname)) != NULL)
|
||||
mntfromname = fs->fs_spec;
|
||||
|
@ -234,10 +233,10 @@ main(argc, argv)
|
|||
}
|
||||
if ((fs = getfsfile(*argv)) == NULL &&
|
||||
(fs = getfsspec(*argv)) == NULL)
|
||||
errx(1, "%s: unknown special file or file system.",
|
||||
errx(1, "%s: unknown special file or file system",
|
||||
*argv);
|
||||
if (BADTYPE(fs->fs_type))
|
||||
errx(1, "%s has unknown file system type.",
|
||||
errx(1, "%s has unknown file system type",
|
||||
*argv);
|
||||
rval = mountfs(fs->fs_vfstype, fs->fs_spec, fs->fs_file,
|
||||
init_flags, options, fs->fs_mntops);
|
||||
|
@ -355,7 +354,7 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
|||
|
||||
if (realpath(name, mntpath) != NULL && stat(mntpath, &sb) == 0) {
|
||||
if (!S_ISDIR(sb.st_mode)) {
|
||||
warnx("%s: Not a directory", mntpath);
|
||||
warnx("%s: not a directory", mntpath);
|
||||
return (1);
|
||||
}
|
||||
} else {
|
||||
|
@ -386,7 +385,7 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
|||
/*
|
||||
* XXX
|
||||
* The mount_mfs (newfs) command uses -o to select the
|
||||
* optimisation mode. We don't pass the default "-o rw"
|
||||
* optimization mode. We don't pass the default "-o rw"
|
||||
* for that reason.
|
||||
*/
|
||||
if (flags & MNT_UPDATE)
|
||||
|
@ -427,10 +426,8 @@ mountfs(vfstype, spec, name, flags, options, mntopts)
|
|||
char *cp;
|
||||
for (edir = edirs; *edir; edir++)
|
||||
len += strlen(*edir) + 2; /* ", " */
|
||||
if ((cp = malloc(len)) == NULL) {
|
||||
warn(NULL);
|
||||
exit(1);
|
||||
}
|
||||
if ((cp = malloc(len)) == NULL)
|
||||
errx(1, "malloc failed");
|
||||
cp[0] = '\0';
|
||||
for (edir = edirs; *edir; edir++) {
|
||||
strcat(cp, *edir);
|
||||
|
@ -529,7 +526,7 @@ catopt(s0, s1)
|
|||
if (s0 && *s0) {
|
||||
i = strlen(s0) + strlen(s1) + 1 + 1;
|
||||
if ((cp = malloc(i)) == NULL)
|
||||
err(1, NULL);
|
||||
errx(1, "malloc failed");
|
||||
(void)snprintf(cp, i, "%s,%s", s0, s1);
|
||||
} else
|
||||
cp = strdup(s1);
|
||||
|
@ -570,12 +567,10 @@ void
|
|||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"usage: mount %s %s\n mount %s\n mount %s\n",
|
||||
"[-dfpruvw] [-o options] [-t ufs | external_type]",
|
||||
"special node",
|
||||
"[-adfpruvw] [-t ufs | external_type]",
|
||||
"[-dfpruvw] special | node");
|
||||
(void)fprintf(stderr, "%s\n%s\n%s\n",
|
||||
"usage: mount [-dfpruvw] [-o options] [-t ufs | external_type] special node",
|
||||
" mount [-adfpruvw] [-t ufs | external_type]",
|
||||
" mount [-dfpruvw] special | node");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,10 +40,9 @@ static const char copyright[] =
|
|||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mount_ufs.c 8.4 (Berkeley) 4/26/95";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id: mount_ufs.c,v 1.12 1998/03/08 19:03:05 steve Exp $";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -52,8 +51,6 @@ static const char rcsid[] =
|
|||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <ufs/ufs/ufsmount.h>
|
||||
|
@ -132,7 +129,7 @@ mount_ufs(argc, argv)
|
|||
result = -1;
|
||||
/*
|
||||
* If we are mounting root, and we have a mount of something that
|
||||
* might be the compatability slice, try mounting other slices
|
||||
* might be the compatibility slice, try mounting other slices
|
||||
* first. If the kernel has done the right thing and mounted
|
||||
* the slice because the disk is really sliced, this will find
|
||||
* the real root filesystem. If not, we'll try what was supplied.
|
||||
|
@ -158,21 +155,22 @@ mount_ufs(argc, argv)
|
|||
#else
|
||||
if (mount(vfc.vfc_name, fs_name, mntflags, &args) < 0) {
|
||||
#endif
|
||||
(void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name);
|
||||
switch (errno) {
|
||||
case EMFILE:
|
||||
(void)fprintf(stderr, "mount table full.\n");
|
||||
warnx("%s on %s: mount table full",
|
||||
args.fspec, fs_name);
|
||||
break;
|
||||
case EINVAL:
|
||||
if (mntflags & MNT_UPDATE)
|
||||
(void)fprintf(stderr,
|
||||
"Specified device does not match mounted device.\n");
|
||||
warnx(
|
||||
"%s on %s: specified device does not match mounted device",
|
||||
args.fspec, fs_name);
|
||||
else
|
||||
(void)fprintf(stderr,
|
||||
"Incorrect super block.\n");
|
||||
warnx("%s on %s: incorrect super block",
|
||||
args.fspec, fs_name);
|
||||
break;
|
||||
default:
|
||||
(void)fprintf(stderr, "%s\n", strerror(errno));
|
||||
warn(NULL);
|
||||
break;
|
||||
}
|
||||
return (1);
|
||||
|
|
|
@ -34,16 +34,14 @@
|
|||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)vfslist.c 8.1 (Berkeley) 5/8/95";
|
||||
#else
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
|
@ -83,7 +81,7 @@ makevfslist(fslist)
|
|||
if (*nextcp == ',')
|
||||
i++;
|
||||
if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) {
|
||||
warn(NULL);
|
||||
warnx("malloc failed");
|
||||
return (NULL);
|
||||
}
|
||||
nextcp = fslist;
|
||||
|
|
Loading…
Reference in a new issue