index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Sami Kerola <kerolasa@iki.fi> | 2013-09-02 21:30:47 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-09-04 09:51:20 +1000 |
commit | 8a72761743d746ed0a9b8b1201672e8ea0b8af4d (patch) | |
tree | 1bd3d2cd1032e3c52d39f3db91627afee776c9a8 | |
parent | a86015f73fdda878287a2ad21011594862bf506a (diff) |
-rw-r--r-- | src/pacman/util.c | 14 |
diff --git a/src/pacman/util.c b/src/pacman/util.c index 9eb0042e..6da1cd40 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -190,15 +190,13 @@ int rmrf(const char *path) if(!unlink(path)) { return 0; } else { - if(errno == ENOENT) { + switch(errno) { + case ENOENT: return 0; - } else if(errno == EPERM) { - /* fallthrough */ - } else if(errno == EISDIR) { - /* fallthrough */ - } else if(errno == ENOTDIR) { - return 1; - } else { + case EPERM: + case EISDIR: + break; + default: /* not a directory */ return 1; } |