Source-Changes-HG archive

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

[src/netbsd-1-5]: src/bin/rm Pull up revision 1.28 (requested by lukem):



details:   https://anonhg.NetBSD.org/src/rev/0005cdd19dfb
branches:  netbsd-1-5
changeset: 492930:0005cdd19dfb
user:      he <he%NetBSD.org@localhost>
date:      Wed Mar 06 22:28:00 2002 +0000

description:
Pull up revision 1.28 (requested by lukem):
  Fix a problem where ``rm -rf foo'' exits with a non-zero exit status
  on a read-only file system even if foo doesn't exist.

diffstat:

 bin/rm/rm.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r a9175e91df0a -r 0005cdd19dfb bin/rm/rm.c
--- a/bin/rm/rm.c       Wed Mar 06 22:25:07 2002 +0000
+++ b/bin/rm/rm.c       Wed Mar 06 22:28:00 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rm.c,v 1.26 1999/11/09 15:06:32 drochner Exp $ */
+/*     $NetBSD: rm.c,v 1.26.4.1 2002/03/06 22:28:00 he Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)rm.c       8.8 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: rm.c,v 1.26 1999/11/09 15:06:32 drochner Exp $");
+__RCSID("$NetBSD: rm.c,v 1.26.4.1 2002/03/06 22:28:00 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -191,14 +191,15 @@
                         * FTS_NS: assume that if can't stat the file, it
                         * can't be unlinked.
                         */
-                       if (!needstat)
-                               break;
-                       if (!fflag || !NONEXISTENT(p->fts_errno)) {
+                       if (fflag && NONEXISTENT(p->fts_errno))
+                               continue;
+                       if (needstat) {
                                warnx("%s: %s",
                                    p->fts_path, strerror(p->fts_errno));
                                eval = 1;
+                               continue;
                        }
-                       continue;
+                       break;
                case FTS_D:
                        /* Pre-order: give user chance to skip. */
                        if (!fflag && !check(p->fts_path, p->fts_accpath,



Home | Main Index | Thread Index | Old Index