Sync with FreeBSD rm(1) with my modifications. Some things have been
authorLiam J. Foy <liamfoy@dragonflybsd.org>
Sat, 6 Nov 2004 19:37:44 +0000 (19:37 +0000)
committerLiam J. Foy <liamfoy@dragonflybsd.org>
Sat, 6 Nov 2004 19:37:44 +0000 (19:37 +0000)
commite13bfb7433f307cfbd30987236074c4d23e23202
treee16264c8011171d3fc316bd76224bd20a360fb30
parent81d99bf0b7c6b5936567b3d6d1eb81d3a1e64842
Sync with FreeBSD rm(1) with my modifications. Some things have been
left out of this sync for time being.

- Fix the leakage of a file descriptor in rm_overwrite for non-fatal
  errors(this is for rm -P).
- Fix the fatal malloc() error message.
- When the P flag is set (i.e. Overwrite regular files before deleting them),
  do only unlink the file if we could indeed overwrite the file. See
  http://www.freebsd.org/cgi/cvsweb.cgi/src/bin/rm/rm.c?rev=1.45&content-type=text/x-cvsweb-markup
  for more details.
- Fix poor wording in comment.
- When fts_read() cannot stat the file, it can't be unlinked.  At
  that case, don't display error message when -f flag is used.
- Kindly let the user know rm(1) could not overwrite non-regular
  files and continue to unlink.
- Static functions.
- Constify rw_overwrite() and check().

Ok'ed by: kernel@ eirikn@ and dillon@
bin/rm/rm.c