index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Aaron Griffin <aaron@archlinux.org> | 2007-03-19 04:49:28 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-03-19 04:49:28 +0000 |
commit | 22206d5beab9df816872a2f78280a4b35ecac34d (patch) | |
tree | e90bebebcbe7fa6c57c3309b324dba7d8fd3e0fb /lib/libalpm/util.c | |
parent | bd55cf548c63958e6d4e8c15ccd5bed3972e0574 (diff) |
-rw-r--r-- | lib/libalpm/util.c | 9 |
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index be9eeb31..2b3847ad 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -310,21 +310,20 @@ int _alpm_rmrf(const char *path) struct dirent *dp; DIR *dirp; char name[PATH_MAX]; - struct stat st; + struct stat st; - if(stat(path, &st) == 0) { - if(S_ISREG(st.st_mode)) { + if(lstat(path, &st) == 0) { + if(!S_ISDIR(st.st_mode)) { if(!unlink(path)) { return(0); } else { if(errno == ENOENT) { return(0); } else { - /* not a directory */ return(1); } } - } else if(S_ISDIR(st.st_mode)) { + } else { if((dirp = opendir(path)) == (DIR *)-1) { return(1); } |