NetBSD Problem Report #48095

From nakayosh@leto.eonet.ne.jp  Mon Jul 29 12:55:06 2013
Return-Path: <nakayosh@leto.eonet.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 590BD70B29
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 29 Jul 2013 12:55:06 +0000 (UTC)
Message-Id: <20130729125502.DB1EF1AF2B7@ae0000-mailauth14.eo.k-opti.ad.jp>
Date: Mon, 29 Jul 2013 21:55:02 +0900 (JST)
From: nakayosh@leto.eonet.ne.jp
Reply-To: nakayosh@leto.eonet.ne.jp
To: gnats-bugs@NetBSD.org
Subject: pax(1): casts from time_t to long
X-Send-Pr-Version: 3.95

>Number:         48095
>Category:       bin
>Synopsis:       pax(1): casts from time_t to long
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 29 13:00:00 +0000 2013
>Closed-Date:    Thu Aug 08 21:26:26 +0000 2013
>Last-Modified:  Thu Aug 08 21:26:26 +0000 2013
>Originator:     NAKAJIMA Yoshihiro
>Release:        NetBSD-current/20130726
>Organization:
>Environment:
System: NetBSD vajra 6.99.23 NetBSD 6.99.23 (VAJRA) #3: Sun Jul 28 16:42:13 JST 2013 nakayosh@vajra:/usr/src/sys/arch/i386/compile/VAJRA i386
Architecture: i386
Machine: i386
>Description:

There are two casts from time_t to long in pax(1).
timeval in 4.4BSD is defined as:

struct timeval {
	long	tv_sec;
	long	tv_usec;
};

I think they are the remains.

>How-To-Repeat:
>Fix:

diff -u src/bin/pax/file_subs.c.ORIG src/bin/pax/file_subs.c
--- src/bin/pax/file_subs.c.ORIG	2009-04-08 04:52:35.000000000 +0900
+++ src/bin/pax/file_subs.c	2013-07-29 21:47:05.000000000 +0900
@@ -791,9 +791,9 @@
 	struct timeval tv[2];
 	struct stat sb;

-	tv[0].tv_sec = (long)atime;
+	tv[0].tv_sec = atime;
 	tv[0].tv_usec = 0;
-	tv[1].tv_sec = (long)mtime;
+	tv[1].tv_sec = mtime;
 	tv[1].tv_usec = 0;
 	if (!frc && (!patime || !pmtime)) {
 		/*

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48095 CVS commit: src/bin/pax
Date: Mon, 29 Jul 2013 13:46:37 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Mon Jul 29 17:46:36 UTC 2013

 Modified Files:
 	src/bin/pax: file_subs.c

 Log Message:
 PR/48095: NAKAJIMA Yoshihiro: remove casts from time_t to long


 To generate a diff of this commit:
 cvs rdiff -u -r1.62 -r1.63 src/bin/pax/file_subs.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: snj@NetBSD.org
State-Changed-When: Thu, 08 Aug 2013 21:26:26 +0000
State-Changed-Why:
christos committed this.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.