[Midnightbsd-cvs] src [11325] trunk/usr.bin/time/time.c: minor changes

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jul 4 17:04:12 EDT 2018


Revision: 11325
          http://svnweb.midnightbsd.org/src/?rev=11325
Author:   laffer1
Date:     2018-07-04 17:04:11 -0400 (Wed, 04 Jul 2018)
Log Message:
-----------
minor changes

Modified Paths:
--------------
    trunk/usr.bin/time/Makefile
    trunk/usr.bin/time/time.1
    trunk/usr.bin/time/time.c

Property Changed:
----------------
    trunk/usr.bin/time/time.1

Modified: trunk/usr.bin/time/Makefile
===================================================================
--- trunk/usr.bin/time/Makefile	2018-07-04 21:03:42 UTC (rev 11324)
+++ trunk/usr.bin/time/Makefile	2018-07-04 21:04:11 UTC (rev 11325)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/time/Makefile 201386 2010-01-02 10:27:05Z ed $
 
 PROG=	time
 

Modified: trunk/usr.bin/time/time.1
===================================================================
--- trunk/usr.bin/time/time.1	2018-07-04 21:03:42 UTC (rev 11324)
+++ trunk/usr.bin/time/time.1	2018-07-04 21:04:11 UTC (rev 11325)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -26,7 +27,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)time.1	8.1 (Berkeley) 6/6/93
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/time/time.1 216370 2010-12-11 08:32:16Z joel $
 .\"
 .Dd May 14, 2006
 .Dt TIME 1


Property changes on: trunk/usr.bin/time/time.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/time/time.c
===================================================================
--- trunk/usr.bin/time/time.c	2018-07-04 21:03:42 UTC (rev 11324)
+++ trunk/usr.bin/time/time.c	2018-07-04 21:04:11 UTC (rev 11325)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1987, 1988, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +39,7 @@
 static char sccsid[] = "@(#)time.c	8.1 (Berkeley) 6/6/93";
 #endif
 static const char rcsid[] =
-  "$MidnightBSD$";
+  "$FreeBSD: stable/10/usr.bin/time/time.c 244034 2012-12-08 17:41:39Z jilles $";
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -112,19 +113,17 @@
 	argv += optind;
 
 	if (ofn) {
-	        if ((out = fopen(ofn, aflag ? "a" : "w")) == NULL)
+	        if ((out = fopen(ofn, aflag ? "ae" : "we")) == NULL)
 		        err(1, "%s", ofn);
 		setvbuf(out, (char *)NULL, _IONBF, (size_t)0);
 	}
 
-	gettimeofday(&before_tv, (struct timezone *)NULL);
+	(void)gettimeofday(&before_tv, NULL);
 	switch(pid = fork()) {
 	case -1:			/* error */
 		err(1, "time");
 		/* NOTREACHED */
 	case 0:				/* child */
-		if (ofn)
-			fclose(out);
 		execvp(*argv, argv);
 		err(errno == ENOENT ? 127 : 126, "%s", *argv);
 		/* NOTREACHED */
@@ -134,7 +133,7 @@
 	(void)signal(SIGQUIT, SIG_IGN);
 	(void)signal(SIGINFO, siginfo);
 	while (wait4(pid, &status, 0, &ru) != pid);
-	gettimeofday(&after, (struct timezone *)NULL);
+	(void)gettimeofday(&after, NULL);
 	if ( ! WIFEXITED(status))
 		warnx("command terminated abnormally");
 	exitonsig = WIFSIGNALED(status) ? WTERMSIG(status) : 0;
@@ -297,7 +296,7 @@
 	struct timeval after;
 	struct rusage ru;
 
-	gettimeofday(&after, (struct timezone *)NULL);
+	(void)gettimeofday(&after, NULL);
 	getrusage(RUSAGE_CHILDREN, &ru);
 	showtime(stdout, &before_tv, &after, &ru);
 }



More information about the Midnightbsd-cvs mailing list