Commit 3b75c79c authored by Harald Sitter's avatar Harald Sitter 🌈
Browse files

smb: do not throw user visible warnings about ENOENT

the user won't be able to do anything about it and the scenario can
actually appear rather easily if a file disappears between us obtaining
the dir list and the stat call (e.g. with the upcoming kdirnotify tech
that happens pretty much always).

this is now also in line with the more modern readdirplus2 which also
doesn't pay any special attention to failed stats.
parent 0c79c197
......@@ -213,10 +213,11 @@ void SMBCDiscoverer::discoverNext()
// Set stat information
m_url.addPath(name);
const int statErr = m_slave->browse_stat_path(m_url, entry);
if (statErr) {
if (statErr == ENOENT || statErr == ENOTDIR) {
m_slave->reportWarning(m_url, statErr);
}
if (statErr != 0) {
// The entry can disappear in the time span between
// listing and the stat call. There's nothing we or the user
// can do about it. Log the incident and move on with listing.
qCWarning(KIO_SMB_LOG) << "Failed to stat" << m_url << statErr;
} else {
emit newDiscovery(Discovery::Ptr(new SMBCDiscovery(entry)));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment