Subject: bin/20332: rm(1) returns incorrect exit code
To: None <>
From: Matthias Scheler <>
List: netbsd-bugs
Date: 02/13/2003 16:27:53
>Number:         20332
>Category:       bin
>Synopsis:       rm(1) returns incorrect exit code
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 13 07:28:00 PST 2003
>Release:        NetBSD 1.6N 2002-02-13 sources
Matthias Scheler                        
System: NetBSD 1.6N NetBSD 1.6N (LYSSA) #0: Thu Feb 13 14:03:32 CET 2003 i386
Architecture: i386
Machine: i386
During a "make cleandir" in "/usr/src" I experienced several errors:

rm -f llib-li386.ln  pcio.ln comio_direct.ln getsecs.ln gatea20.ln getextmemx.ln printmemlist.ln pread.ln menuutils.ln parseutils.ln bootinfo.ln bootinfo_biosgeom.ln bootinfo_memmap.ln panic.ln biosdisk.ln biosdisk_ll.ln diskbuf.ln
rm -f .depend /src/NetBSD-current/src/sys/arch/i386/stand/lib/tags
rm -rf lib
*** Error code 1

It turns out that our rm(1) got broken by recent changes and returns an
incorrect exit code after removing a directory.

tron@lyssa:/tmp>mkdir bla
tron@lyssa:/tmp>/bin/rm -rf bla
tron@lyssa:/tmp>echo $?
tron@lyssa:/tmp>ls bla
ls: bla: No such file or directory

None provided.