CVS commit: src/usr.bin/tee

2017-07-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul  4 07:05:16 UTC 2017

Modified Files:
src/usr.bin/tee: tee.1

Log Message:
Add EXIT STATUS section. Use Ex.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/tee/tee.1

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

Modified files:

Index: src/usr.bin/tee/tee.1
diff -u src/usr.bin/tee/tee.1:1.8 src/usr.bin/tee/tee.1:1.9
--- src/usr.bin/tee/tee.1:1.8	Mon Jul  3 21:34:21 2017
+++ src/usr.bin/tee/tee.1	Tue Jul  4 07:05:16 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tee.1,v 1.8 2017/07/03 21:34:21 wiz Exp $
+.\"	$NetBSD: tee.1,v 1.9 2017/07/04 07:05:16 wiz Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -73,10 +73,8 @@ utility takes the default action for all
 except in the event of the
 .Fl i
 option.
-.Pp
-The
-.Nm
-utility exits 0 on success, and >0 if an error occurs.
+.Sh EXIT STATUS
+.Ex -std tee
 .Sh STANDARDS
 The
 .Nm



CVS commit: src/usr.bin/tee

2013-03-06 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Mar  6 11:44:11 UTC 2013

Modified Files:
src/usr.bin/tee: tee.c

Log Message:
use more appropriate types
remove unnecessary casts


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/tee/tee.c

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

Modified files:

Index: src/usr.bin/tee/tee.c
diff -u src/usr.bin/tee/tee.c:1.10 src/usr.bin/tee/tee.c:1.11
--- src/usr.bin/tee/tee.c:1.10	Tue Mar 20 20:34:59 2012
+++ src/usr.bin/tee/tee.c	Wed Mar  6 11:44:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tee.c,v 1.10 2012/03/20 20:34:59 matt Exp $	*/
+/*	$NetBSD: tee.c,v 1.11 2013/03/06 11:44:11 yamt Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = @(#)tee.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: tee.c,v 1.10 2012/03/20 20:34:59 matt Exp $);
+__RCSID($NetBSD: tee.c,v 1.11 2013/03/06 11:44:11 yamt Exp $);
 #endif
 
 #include sys/types.h
@@ -68,8 +68,8 @@ int
 main(int argc, char *argv[])
 {
 	LIST *p;
-	int n, fd, rval, wval;
-	char *bp;
+	ssize_t rval;
+	int fd;
 	int append, ch, exitval;
 	char *buf;
 #define	BSIZE (8 * 1024)
@@ -93,7 +93,7 @@ main(int argc, char *argv[])
 	argv += optind;
 	argc -= optind;
 
-	if ((buf = malloc((size_t)BSIZE)) == NULL)
+	if ((buf = malloc(BSIZE)) == NULL)
 		err(1, malloc);
 
 	add(STDOUT_FILENO, stdout);
@@ -108,8 +108,10 @@ main(int argc, char *argv[])
 
 	while ((rval = read(STDIN_FILENO, buf, BSIZE))  0)
 		for (p = head; p; p = p-next) {
-			n = rval;
-			bp = buf;
+			const char *bp = buf;
+			size_t n = rval;
+			ssize_t wval;
+
 			do {
 if ((wval = write(p-fd, bp, n)) == -1) {
 	warn(%s, p-name);
@@ -139,7 +141,7 @@ add(int fd, const char *name)
 {
 	LIST *p;
 
-	if ((p = malloc((size_t)sizeof(LIST))) == NULL)
+	if ((p = malloc(sizeof(LIST))) == NULL)
 		err(1, malloc);
 	p-fd = fd;
 	p-name = name;



CVS commit: src/usr.bin/tee

2009-04-13 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Mon Apr 13 23:45:50 UTC 2009

Modified Files:
src/usr.bin/tee: tee.c

Log Message:
Fix -Wcast-qual issues


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/tee/tee.c

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

Modified files:

Index: src/usr.bin/tee/tee.c
diff -u src/usr.bin/tee/tee.c:1.8 src/usr.bin/tee/tee.c:1.9
--- src/usr.bin/tee/tee.c:1.8	Mon Jul 21 14:19:26 2008
+++ src/usr.bin/tee/tee.c	Mon Apr 13 23:45:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: tee.c,v 1.8 2008/07/21 14:19:26 lukem Exp $	*/
+/*	$NetBSD: tee.c,v 1.9 2009/04/13 23:45:50 lukem Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)tee.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: tee.c,v 1.8 2008/07/21 14:19:26 lukem Exp $);
+__RCSID($NetBSD: tee.c,v 1.9 2009/04/13 23:45:50 lukem Exp $);
 #endif
 
 #include sys/types.h
@@ -57,11 +57,11 @@
 typedef struct _list {
 	struct _list *next;
 	int fd;
-	char *name;
+	const char *name;
 } LIST;
 LIST *head;
 
-void	add __P((int, char *));
+void	add __P((int, const char *));
 int	main __P((int, char **));
 
 int
@@ -139,7 +139,7 @@
 void
 add(fd, name)
 	int fd;
-	char *name;
+	const char *name;
 {
 	LIST *p;