debuga(__FILE__,__LINE__,_("Cannot stat \"%s\": %s\n"),dname,strerror(errno));
exit(EXIT_FAILURE);
}
- if (S_ISDIR(st.st_mode)) {
- unlinkdir(dname,0);
- } else if (!S_ISREG(st.st_mode)) {
+ if (!S_ISDIR(st.st_mode) && !S_ISREG(st.st_mode)) {
debuga(__FILE__,__LINE__,_("Unknown path type for \"%s\". Check temporary directory\n"),dname);
exit(EXIT_FAILURE);
}
debuga(__FILE__,__LINE__,_("Cannot stat \"%s\": %s\n"),dname,strerror(errno));
exit(EXIT_FAILURE);
}
- if (S_ISREG(st.st_mode)) {
+ if (S_ISDIR(st.st_mode)) {
+ unlinkdir(dname,0);
+ } else if (S_ISREG(st.st_mode)) {
if (unlink(dname)) {
debuga(__FILE__,__LINE__,_("Cannot delete \"%s\": %s\n"),dname,strerror(errno));
exit(EXIT_FAILURE);