Merge from Lite2
This commit is contained in:
parent
a37c38b8d8
commit
9d1741b9da
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=23673
@ -38,7 +38,7 @@ static char copyright[] =
|
|||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char sccsid[] = "@(#)dumpfs.c 8.2 (Berkeley) 2/2/94";
|
static char sccsid[] = "@(#)dumpfs.c 8.5 (Berkeley) 4/29/95";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -47,13 +47,14 @@ static char sccsid[] = "@(#)dumpfs.c 8.2 (Berkeley) 2/2/94";
|
|||||||
#include <ufs/ufs/dinode.h>
|
#include <ufs/ufs/dinode.h>
|
||||||
#include <ufs/ffs/fs.h>
|
#include <ufs/ffs/fs.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <err.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#include <fstab.h>
|
#include <fstab.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
union {
|
union {
|
||||||
struct fs fs;
|
struct fs fs;
|
||||||
@ -82,7 +83,7 @@ main(argc, argv)
|
|||||||
register struct fstab *fs;
|
register struct fstab *fs;
|
||||||
int ch, eval;
|
int ch, eval;
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "")) != EOF)
|
while ((ch = getopt(argc, argv, "")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case '?':
|
case '?':
|
||||||
default:
|
default:
|
||||||
@ -115,13 +116,12 @@ dumpfs(name)
|
|||||||
if (read(fd, &afs, SBSIZE) != SBSIZE)
|
if (read(fd, &afs, SBSIZE) != SBSIZE)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (afs.fs_magic != FS_MAGIC) {
|
if (afs.fs_magic != FS_MAGIC) {
|
||||||
warnx("%s: superblock has bad magic number, skipping.",
|
warnx("%s: superblock has bad magic number, skipped", name);
|
||||||
name);
|
(void)close(fd);
|
||||||
(void) close(fd);
|
return (1);
|
||||||
return (1);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (afs.fs_postblformat == FS_42POSTBLFMT)
|
if (afs.fs_postblformat == FS_42POSTBLFMT)
|
||||||
afs.fs_nrpos = 8;
|
afs.fs_nrpos = 8;
|
||||||
dev_bsize = afs.fs_fsize / fsbtodb(&afs, 1);
|
dev_bsize = afs.fs_fsize / fsbtodb(&afs, 1);
|
||||||
@ -219,7 +219,7 @@ dumpfs(name)
|
|||||||
|
|
||||||
err: if (fd != -1)
|
err: if (fd != -1)
|
||||||
(void)close(fd);
|
(void)close(fd);
|
||||||
(void)fprintf(stderr, "dumpfs: %s: %s\n", name, strerror(errno));
|
warn("%s", name);
|
||||||
return (1);
|
return (1);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ dumpcg(name, fd, c)
|
|||||||
(off_t)dev_bsize, SEEK_SET)) == (off_t)-1)
|
(off_t)dev_bsize, SEEK_SET)) == (off_t)-1)
|
||||||
return (1);
|
return (1);
|
||||||
if (read(fd, &acg, afs.fs_bsize) != afs.fs_bsize) {
|
if (read(fd, &acg, afs.fs_bsize) != afs.fs_bsize) {
|
||||||
(void)fprintf(stderr, "dumpfs: %s: error reading cg\n", name);
|
warnx("%s: error reading cg", name);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
printf("magic\t%x\ttell\t%qx\ttime\t%s",
|
printf("magic\t%x\ttell\t%qx\ttime\t%s",
|
||||||
|
Loading…
Reference in New Issue
Block a user