aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/fsdb/Makefile2
-rw-r--r--sbin/fsdb/fsdb.86
-rw-r--r--sbin/fsdb/fsdb.c16
-rw-r--r--sbin/fsdb/fsdbutil.c12
4 files changed, 19 insertions, 17 deletions
diff --git a/sbin/fsdb/Makefile b/sbin/fsdb/Makefile
index 381b81783ad4..fe8f048f32da 100644
--- a/sbin/fsdb/Makefile
+++ b/sbin/fsdb/Makefile
@@ -2,7 +2,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
PROG= fsdb
-MAN= fsdb.8
+MAN8= fsdb.8
SRCS= fsdb.c fsdbutil.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
diff --git a/sbin/fsdb/fsdb.8 b/sbin/fsdb/fsdb.8
index a44d191d7a83..92469f3990ff 100644
--- a/sbin/fsdb/fsdb.8
+++ b/sbin/fsdb/fsdb.8
@@ -28,7 +28,7 @@
.\"
.Dd September 14, 1995
.Dt FSDB 8
-.Os NetBSD
+.Os FreeBSD
.Sh NAME
.Nm fsdb
.Nd FFS debugging/editing tool
@@ -220,7 +220,9 @@ uses the source code for
.Xr fsck 8
to implement most of the file system manipulation code. The remainder of
.Nm
-first appeared in NetBSD.
+first appeared in NetBSD, written by John T. Kohl.
+.br
+Peter Wemm ported it to FreeBSD.
.Sh WARNING
Use this tool with extreme caution--you can damage an FFS file system
beyond what
diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c
index 8a5ad7b3ddc2..8a7bb7a73175 100644
--- a/sbin/fsdb/fsdb.c
+++ b/sbin/fsdb/fsdb.c
@@ -104,7 +104,7 @@ main(argc, argv)
rval = cmdloop();
sblock.fs_clean = 0; /* mark it dirty */
sbdirty();
- ckfini(0);
+ ckfini();
printf("*** FILE SYSTEM MARKED DIRTY\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");
@@ -781,9 +781,9 @@ CMDFUNCSTART(chgroup)
}
int
-dotime(name, rsec, rnsec)
+dotime(name, rts)
char *name;
- int32_t *rsec, *rnsec;
+ struct timespec *rts;
{
char *p, *val;
struct tm t;
@@ -832,14 +832,14 @@ badformat:
warnx("date/time out of range");
return 1;
}
- *rsec = sec;
- *rnsec = nsec;
+ rts->ts_sec = sec;
+ rts->ts_nsec = nsec;
return 0;
}
CMDFUNCSTART(chmtime)
{
- if (dotime(argv[1], &curinode->di_ctime, &curinode->di_ctimensec))
+ if (dotime(argv[1], &curinode->di_ctime))
return 1;
inodirty();
printactive();
@@ -848,7 +848,7 @@ CMDFUNCSTART(chmtime)
CMDFUNCSTART(chatime)
{
- if (dotime(argv[1], &curinode->di_ctime, &curinode->di_ctimensec))
+ if (dotime(argv[1], &curinode->di_ctime))
return 1;
inodirty();
printactive();
@@ -857,7 +857,7 @@ CMDFUNCSTART(chatime)
CMDFUNCSTART(chctime)
{
- if (dotime(argv[1], &curinode->di_ctime, &curinode->di_ctimensec))
+ if (dotime(argv[1], &curinode->di_ctime))
return 1;
inodirty();
printactive();
diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c
index 1003b9d4d3e1..262bc1a66d3d 100644
--- a/sbin/fsdb/fsdbutil.c
+++ b/sbin/fsdb/fsdbutil.c
@@ -130,15 +130,15 @@ printstat(cp, inum, dp)
break;
}
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],
- dp->di_mtimensec);
- p = ctime(&dp->di_ctime);
+ dp->di_mtime.ts_nsec);
+ p = ctime(&dp->di_ctime.ts_sec);
printf("\n\tCTIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20],
- dp->di_ctimensec);
- p = ctime(&dp->di_atime);
+ dp->di_ctime.ts_nsec);
+ p = ctime(&dp->di_atime.ts_sec);
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))
printf("OWNER=%s ", pw->pw_name);