Commit FreeBSD-specific changes. Mainly to do with structure layout

differences that we dont have.
This commit is contained in:
Peter Wemm 1995-11-03 22:47:24 +00:00
parent fd0348496b
commit d4d864ba62
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12051
4 changed files with 19 additions and 17 deletions

View File

@ -2,7 +2,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93 # @(#)Makefile 8.1 (Berkeley) 6/5/93
PROG= fsdb PROG= fsdb
MAN= fsdb.8 MAN8= fsdb.8
SRCS= fsdb.c fsdbutil.c \ SRCS= fsdb.c fsdbutil.c \
dir.c inode.c pass1.c pass1b.c pass2.c pass3.c pass4.c \ dir.c inode.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
pass5.c preen.c setup.c utilities.c ffs_subr.c ffs_tables.c pass5.c preen.c setup.c utilities.c ffs_subr.c ffs_tables.c

View File

@ -28,7 +28,7 @@
.\" .\"
.Dd September 14, 1995 .Dd September 14, 1995
.Dt FSDB 8 .Dt FSDB 8
.Os NetBSD .Os FreeBSD
.Sh NAME .Sh NAME
.Nm fsdb .Nm fsdb
.Nd FFS debugging/editing tool .Nd FFS debugging/editing tool
@ -220,7 +220,9 @@ uses the source code for
.Xr fsck 8 .Xr fsck 8
to implement most of the file system manipulation code. The remainder of to implement most of the file system manipulation code. The remainder of
.Nm .Nm
first appeared in NetBSD. first appeared in NetBSD, written by John T. Kohl.
.br
Peter Wemm ported it to FreeBSD.
.Sh WARNING .Sh WARNING
Use this tool with extreme caution--you can damage an FFS file system Use this tool with extreme caution--you can damage an FFS file system
beyond what beyond what

View File

@ -104,7 +104,7 @@ main(argc, argv)
rval = cmdloop(); rval = cmdloop();
sblock.fs_clean = 0; /* mark it dirty */ sblock.fs_clean = 0; /* mark it dirty */
sbdirty(); sbdirty();
ckfini(0); ckfini();
printf("*** FILE SYSTEM MARKED DIRTY\n"); printf("*** FILE SYSTEM MARKED DIRTY\n");
printf("*** BE SURE TO RUN FSCK TO CLEAN UP ANY DAMAGE\n"); printf("*** BE SURE TO RUN FSCK TO CLEAN UP ANY DAMAGE\n");
printf("*** IF IT WAS MOUNTED, RE-MOUNT WITH -u -o reload\n"); printf("*** IF IT WAS MOUNTED, RE-MOUNT WITH -u -o reload\n");
@ -781,9 +781,9 @@ CMDFUNCSTART(chgroup)
} }
int int
dotime(name, rsec, rnsec) dotime(name, rts)
char *name; char *name;
int32_t *rsec, *rnsec; struct timespec *rts;
{ {
char *p, *val; char *p, *val;
struct tm t; struct tm t;
@ -832,14 +832,14 @@ dotime(name, rsec, rnsec)
warnx("date/time out of range"); warnx("date/time out of range");
return 1; return 1;
} }
*rsec = sec; rts->ts_sec = sec;
*rnsec = nsec; rts->ts_nsec = nsec;
return 0; return 0;
} }
CMDFUNCSTART(chmtime) CMDFUNCSTART(chmtime)
{ {
if (dotime(argv[1], &curinode->di_ctime, &curinode->di_ctimensec)) if (dotime(argv[1], &curinode->di_ctime))
return 1; return 1;
inodirty(); inodirty();
printactive(); printactive();
@ -848,7 +848,7 @@ CMDFUNCSTART(chmtime)
CMDFUNCSTART(chatime) CMDFUNCSTART(chatime)
{ {
if (dotime(argv[1], &curinode->di_ctime, &curinode->di_ctimensec)) if (dotime(argv[1], &curinode->di_ctime))
return 1; return 1;
inodirty(); inodirty();
printactive(); printactive();
@ -857,7 +857,7 @@ CMDFUNCSTART(chatime)
CMDFUNCSTART(chctime) CMDFUNCSTART(chctime)
{ {
if (dotime(argv[1], &curinode->di_ctime, &curinode->di_ctimensec)) if (dotime(argv[1], &curinode->di_ctime))
return 1; return 1;
inodirty(); inodirty();
printactive(); printactive();

View File

@ -130,15 +130,15 @@ printstat(cp, inum, dp)
break; break;
} }
printf("I=%lu MODE=%o SIZE=%qu", inum, dp->di_mode, dp->di_size); printf("I=%lu MODE=%o SIZE=%qu", inum, dp->di_mode, dp->di_size);
p = ctime(&dp->di_mtime); p = ctime(&dp->di_mtime.ts_sec);
printf("\n\tMTIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20], printf("\n\tMTIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20],
dp->di_mtimensec); dp->di_mtime.ts_nsec);
p = ctime(&dp->di_ctime); p = ctime(&dp->di_ctime.ts_sec);
printf("\n\tCTIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20], printf("\n\tCTIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20],
dp->di_ctimensec); dp->di_ctime.ts_nsec);
p = ctime(&dp->di_atime); p = ctime(&dp->di_atime.ts_sec);
printf("\n\tATIME=%15.15s %4.4s [%d nsec]\n", &p[4], &p[20], printf("\n\tATIME=%15.15s %4.4s [%d nsec]\n", &p[4], &p[20],
dp->di_atimensec); dp->di_atime.ts_nsec);
if (pw = getpwuid(dp->di_uid)) if (pw = getpwuid(dp->di_uid))
printf("OWNER=%s ", pw->pw_name); printf("OWNER=%s ", pw->pw_name);