summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-16 13:51:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-16 13:51:01 +0000
commitd0e30c00d1e352f6dcae2a60d7270f8ba4a71d76 (patch)
treeb63c6941c1b145752d8ef786f33244157deb4213 /sbin
parent12cf882ebb84905c2a2505bedfa81af87876511a (diff)
handle time_t things that really are not time_t
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dumplfs/dumplfs.c15
-rw-r--r--sbin/fsck/inode.c8
-rw-r--r--sbin/fsck_ffs/inode.c8
-rw-r--r--sbin/fsdb/fsdbutil.c14
4 files changed, 29 insertions, 16 deletions
diff --git a/sbin/dumplfs/dumplfs.c b/sbin/dumplfs/dumplfs.c
index 06eb69d412c..c7764e2d1e8 100644
--- a/sbin/dumplfs/dumplfs.c
+++ b/sbin/dumplfs/dumplfs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dumplfs.c,v 1.6 1995/06/07 17:16:05 cgd Exp $ */
+/* $NetBSD: dumplfs.c,v 1.7 1995/12/14 22:36:34 thorpej Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)dumplfs.c 8.1 (Berkeley) 6/5/93";
#else
-static char rcsid[] = "$NetBSD: dumplfs.c,v 1.6 1995/06/07 17:16:05 cgd Exp $";
+static char rcsid[] = "$NetBSD: dumplfs.c,v 1.7 1995/12/14 22:36:34 thorpej Exp $";
#endif
#endif /* not lint */
@@ -355,6 +355,11 @@ dump_dinode(dip)
struct dinode *dip;
{
int i;
+ time_t at, mt, ct;
+
+ at = dip->di_atime;
+ mt = dip->di_mtime;
+ ct = dip->di_ctime;
(void)printf("%s%d\t%s%d\t%s%d\t%s%d\t%s%d\n",
"mode ", dip->di_mode,
@@ -363,9 +368,9 @@ dump_dinode(dip)
"gid ", dip->di_gid,
"size ", dip->di_size);
(void)printf("%s%s%s%s%s%s",
- "atime ", ctime((time_t *)&dip->di_atime),
- "mtime ", ctime((time_t *)&dip->di_mtime),
- "ctime ", ctime((time_t *)&dip->di_ctime));
+ "atime ", ctime(&at),
+ "mtime ", ctime(&mt),
+ "ctime ", ctime(&ct));
(void)printf("inum %d\n", dip->di_inumber);
(void)printf("Direct Addresses\n");
for (i = 0; i < NDADDR; i++) {
diff --git a/sbin/fsck/inode.c b/sbin/fsck/inode.c
index 1197965862c..54a4130b3e5 100644
--- a/sbin/fsck/inode.c
+++ b/sbin/fsck/inode.c
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.15 1995/06/07 17:16:10 cgd Exp $ */
+/* $NetBSD: inode.c,v 1.16 1995/12/14 22:17:26 thorpej Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)inode.c 8.5 (Berkeley) 2/8/95";
#else
-static char rcsid[] = "$NetBSD: inode.c,v 1.15 1995/06/07 17:16:10 cgd Exp $";
+static char rcsid[] = "$NetBSD: inode.c,v 1.16 1995/12/14 22:17:26 thorpej Exp $";
#endif
#endif /* not lint */
@@ -512,6 +512,7 @@ allocino(request, type)
{
register ino_t ino;
register struct dinode *dp;
+ time_t t;
if (request == 0)
request = ROOTINO;
@@ -540,7 +541,8 @@ allocino(request, type)
return (0);
}
dp->di_mode = type;
- (void)time((time_t *)&dp->di_atime);
+ (void)time(&t);
+ dp->di_atime = t;
dp->di_mtime = dp->di_ctime = dp->di_atime;
dp->di_size = sblock.fs_fsize;
dp->di_blocks = btodb(sblock.fs_fsize);
diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c
index 1197965862c..54a4130b3e5 100644
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.15 1995/06/07 17:16:10 cgd Exp $ */
+/* $NetBSD: inode.c,v 1.16 1995/12/14 22:17:26 thorpej Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)inode.c 8.5 (Berkeley) 2/8/95";
#else
-static char rcsid[] = "$NetBSD: inode.c,v 1.15 1995/06/07 17:16:10 cgd Exp $";
+static char rcsid[] = "$NetBSD: inode.c,v 1.16 1995/12/14 22:17:26 thorpej Exp $";
#endif
#endif /* not lint */
@@ -512,6 +512,7 @@ allocino(request, type)
{
register ino_t ino;
register struct dinode *dp;
+ time_t t;
if (request == 0)
request = ROOTINO;
@@ -540,7 +541,8 @@ allocino(request, type)
return (0);
}
dp->di_mode = type;
- (void)time((time_t *)&dp->di_atime);
+ (void)time(&t);
+ dp->di_atime = t;
dp->di_mtime = dp->di_ctime = dp->di_atime;
dp->di_size = sblock.fs_fsize;
dp->di_blocks = btodb(sblock.fs_fsize);
diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c
index 8d064bca851..d71e25f1f7e 100644
--- a/sbin/fsdb/fsdbutil.c
+++ b/sbin/fsdb/fsdbutil.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fsdbutil.c,v 1.2 1995/10/08 23:18:12 thorpej Exp $ */
+/* $NetBSD: fsdbutil.c,v 1.3 1995/12/14 22:30:45 thorpej Exp $ */
/*
* Copyright (c) 1995 John T. Kohl
@@ -29,7 +29,7 @@
*/
#ifndef lint
-static char rcsid[] = "$NetBSD: fsdbutil.c,v 1.2 1995/10/08 23:18:12 thorpej Exp $";
+static char rcsid[] = "$NetBSD: fsdbutil.c,v 1.3 1995/12/14 22:30:45 thorpej Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -96,6 +96,7 @@ printstat(cp, inum, dp)
{
struct group *grp;
struct passwd *pw;
+ time_t t;
char *p;
printf("%s: ", cp);
@@ -130,13 +131,16 @@ printstat(cp, inum, dp)
break;
}
printf("I=%lu MODE=%o SIZE=%qu", inum, dp->di_mode, dp->di_size);
- p = ctime((time_t *)&dp->di_mtime);
+ t = dp->di_mtime;
+ p = ctime(&t);
printf("\n\tMTIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20],
dp->di_mtimensec);
- p = ctime((time_t *)&dp->di_ctime);
+ t = dp->di_ctime;
+ p = ctime(&t);
printf("\n\tCTIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20],
dp->di_ctimensec);
- p = ctime((time_t *)&dp->di_atime);
+ t = dp->di_atime;
+ p = ctime(&t);
printf("\n\tATIME=%15.15s %4.4s [%d nsec]\n", &p[4], &p[20],
dp->di_atimensec);