Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/cat Simplify previous - sbuf.st_blksize is a uint32_t, s...
details: https://anonhg.NetBSD.org/src/rev/516c125f549d
branches: trunk
changeset: 526709:516c125f549d
user: simonb <simonb%NetBSD.org@localhost>
date: Thu May 09 02:19:42 2002 +0000
description:
Simplify previous - sbuf.st_blksize is a uint32_t, so just use
bsize = MAX(sbuf.st_blksize, BUFSIZ);
and skip playing with SSIZE_MAX altogether.
diffstat:
bin/cat/cat.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diffs (32 lines):
diff -r 94e6f57604b4 -r 516c125f549d bin/cat/cat.c
--- a/bin/cat/cat.c Thu May 09 02:13:10 2002 +0000
+++ b/bin/cat/cat.c Thu May 09 02:19:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cat.c,v 1.30 2002/05/09 02:13:10 thorpej Exp $ */
+/* $NetBSD: cat.c,v 1.31 2002/05/09 02:19:42 simonb Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -47,7 +47,7 @@
#if 0
static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
#else
-__RCSID("$NetBSD: cat.c,v 1.30 2002/05/09 02:13:10 thorpej Exp $");
+__RCSID("$NetBSD: cat.c,v 1.31 2002/05/09 02:19:42 simonb Exp $");
#endif
#endif /* not lint */
@@ -280,12 +280,7 @@
wfd = fileno(stdout);
if (buf == NULL) {
if (fstat(wfd, &sbuf) == 0) {
-#ifndef _LP64
- bsize = MIN(sbuf.st_blksize, SSIZE_MAX);
-#else
- bsize = sbuf.st_blksize;
-#endif
- bsize = MAX(bsize, BUFSIZ);
+ bsize = MAX(sbuf.st_blksize, BUFSIZ);
buf = malloc(bsize);
}
if (buf == NULL) {
Home |
Main Index |
Thread Index |
Old Index