mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
CFileHelpers::removeDir: Better error message
- No error when directory does not exist
Origin commit data
------------------
Branch: ni/coolstream
Commit: 79b94cdfad
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-09-06 (Tue, 06 Sep 2016)
------------------
This commit was generated by Migit
This commit is contained in:
committed by
vanhofen
parent
2bd45d3bea
commit
9cfb1d7302
@@ -1068,8 +1068,14 @@ bool CFileHelpers::removeDir(const char *Dir)
|
|||||||
|
|
||||||
dir = opendir(Dir);
|
dir = opendir(Dir);
|
||||||
if (dir == NULL) {
|
if (dir == NULL) {
|
||||||
fh->setDebugInfo("Error opendir().", __path_file__, __func__, __LINE__);
|
if (errno == ENOENT)
|
||||||
fh->printDebugInfo();
|
return true;
|
||||||
|
if (!fh->getConsoleQuiet())
|
||||||
|
dprintf(DEBUG_NORMAL, "[CFileHelpers %s] remove directory %s: %s\n", __func__, Dir, strerror(errno));
|
||||||
|
char buf[1024];
|
||||||
|
memset(buf, '\0', sizeof(buf));
|
||||||
|
snprintf(buf, sizeof(buf)-1, "remove directory %s: %s", Dir, strerror(errno));
|
||||||
|
fh->setDebugInfo(buf, __path_file__, __func__, __LINE__);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
while ((entry = readdir(dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
|
Reference in New Issue
Block a user