NetBSD-Bugs archive

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

bin/44179: find(1): don't error out while searching for empty dirs.



>Number:         44179
>Category:       bin
>Synopsis:       find(1): don't error out while searching for empty dirs.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 01 07:00:00 +0000 2010
>Originator:     Denise Guo
>Release:        no
>Organization:
XBSD
>Environment:
no
>Description:
don't error out while searching for empty directories when -empty is used.
>How-To-Repeat:
as a non-privileged use, execute:

find /var -empty -type d
>Fix:
--- usr.bin/find/function.c.orig        2010-12-01 14:50:12.000000000 +0800
+++ usr.bin/find/function.c     2010-12-01 14:51:14.000000000 +0800
@@ -453,7 +453,7 @@
                empty = 1;
                dir = opendir(entry->fts_accpath);
                if (dir == NULL)
-                       err(1, "%s", entry->fts_accpath);
+                        return (0);
                for (dp = readdir(dir); dp; dp = readdir(dir))
                        if (dp->d_name[0] != '.' ||
                            (dp->d_name[1] != '\0' &&



Home | Main Index | Thread Index | Old Index