cvs commit: src/bin/cat
Matthew Dillon
dillon at crater.dragonflybsd.org
Sun Nov 7 15:45:43 PST 2004
dillon 2004/11/07 15:44:38 PST
DragonFly src repository
Modified files:
bin/cat cat.c
Log:
The last commit created a memory leak because 'buf' is static. Fix that,
but also make the chosen block size more consistent by basing on the larger
of STDOUT vs rfd rather then just basing it on STDOUT, and change the
constant 1024 to BUFSIZ.
It is unclear whether we should impose a minimum buffer size or a mod
(e.g. x % st_blksize == 0) requirement as well. There are currently no cases
where this matters as anyone in their right mind will use 'dd' instead of
'cat' on special block devices. But at least in regards to /proc/*/map
imposing a minimum based on fstat(rfd, ...) makes sense, though to really
be correct we should also 'fix' procfs to report a block size sufficient to
hold the map data in that case.
Reported-by: Jason Smethers <jason at xxxxxxxxxxxx>
Revision Changes Path
1.13 +33 -11 src/bin/cat/cat.c
http://www.dragonflybsd.org/cvsweb/src/bin/cat/cat.c.diff?r1=1.12&r2=1.13&f=u
More information about the Commits
mailing list