Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Nov 2004 10:58:54 -0800
From:      Jordan Hubbard <jkh@brierdr.com>
To:        standards@freebsd.org
Subject:   Any objections to the following?
Message-ID:  <E6821B92-34DC-11D9-893C-000393DACFAC@brierdr.com>

index | next in thread | raw e-mail

RCS file: /home/ncvs/src/bin/rm/rm.c,v
retrieving revision 1.51
diff -u -r1.51 rm.c
--- rm.c        28 Oct 2004 08:25:30 -0000      1.51
+++ rm.c        12 Nov 2004 19:02:59 -0000
@@ -192,8 +192,11 @@
                 flags |= FTS_NOSTAT;
         if (Wflag)
                 flags |= FTS_WHITEOUT;
-       if (!(fts = fts_open(argv, flags, NULL)))
+       if (!(fts = fts_open(argv, flags, NULL))) {
+               if (fflag)      /* Don't emit diagnostic if force set */
+                       return;
                 err(1, "fts_open");
+       }
         while ((p = fts_read(fts)) != NULL) {
                 switch (p->fts_info) {
                 case FTS_DNR:

This allows:

	rm -rf ""

To behave the same as:

	rm -f ""

Which is to say that no diagnostic will be emitted if you're forcing 
the operation (and ignoring errors).

- Jordan


help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E6821B92-34DC-11D9-893C-000393DACFAC>