DragonFly BSD
DragonFly commits List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

cvs commit: src/bin/cat


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 7 Nov 2004 15:44:38 -0800 (PST)

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@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



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]