]> git.ipfire.org Git - thirdparty/coreutils.git/commit
shred: port to GNU/Linux behavior with tape drives
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 3 Apr 2014 06:28:20 +0000 (23:28 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 3 Apr 2014 06:28:59 +0000 (23:28 -0700)
commit88545ad025b4d9083502889b9f8de9e5ca0b766d
tree1b35edddc1f534c5322e1b39abaad2577e38d1b7
parent9111dd2499ca5c26d2658bf85966e8160f51d280
shred: port to GNU/Linux behavior with tape drives

See: http://bugs.gnu.org/17149
* src/shred.c [__linux__]: Include <sys/mtio.h>.
(dorewind): New function, which works around the lseek problem with
tape drives on GNU/Linux, the same way that dd does.
(dopass): Use it.  New arg ST, needed for dorewind.  All uses changed.
(do_wipefd): Don't rely on undefined behavior on integer overflow
of file sizes.  Use INT_ADD_OVERFLOW instead.
src/shred.c