From: deraadt Date: Sat, 16 Dec 1995 13:50:46 +0000 (+0000) Subject: handle time_t things that really are not time_t X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6ae81f768117aa6bda347dc7875d0aa047efaf19;p=openbsd handle time_t things that really are not time_t --- diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c index d0fc5838324..e08e3fbea45 100644 --- a/libexec/rpc.rusersd/rusers_proc.c +++ b/libexec/rpc.rusersd/rusers_proc.c @@ -27,7 +27,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: rusers_proc.c,v 1.1.1.1 1995/10/18 08:43:21 deraadt Exp $"; +static char rcsid[] = "$Id: rusers_proc.c,v 1.2 1995/12/16 13:50:46 deraadt Exp $"; #endif /* not lint */ #include @@ -156,9 +156,9 @@ getidle(tty, display) #if !defined(i386) kbd_idle = getidle("kbd", NULL); #else -#if __GNUC__ >= 2 -#warning i386 console hack here -#endif + /* + * XXX Icky i386 console hack. + */ kbd_idle = getidle("vga", NULL); #endif mouse_idle = getidle("mouse", NULL); 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 @@ -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);