summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--netfs/daemon/daemonDirectory.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/netfs/daemon/daemonDirectory.cpp b/netfs/daemon/daemonDirectory.cpp
index 7b8905d..5412bbe 100644
--- a/netfs/daemon/daemonDirectory.cpp
+++ b/netfs/daemon/daemonDirectory.cpp
@@ -27,13 +27,13 @@ DirectoryServer::readdir(const Ice::Current &)
errno = 0;
NetFS::NameList list;
while (dirent * d = ::readdir(od)) {
- if (errno) {
- // LCOV_EXCL_START
- throw NetFS::SystemError(errno);
- // LCOV_EXCL_STOP
- }
list.emplace_back(d->d_name);
}
+ if (errno) {
+ // LCOV_EXCL_START
+ throw NetFS::SystemError(errno);
+ // LCOV_EXCL_STOP
+ }
return list;
}
@@ -44,11 +44,6 @@ DirectoryServer::listdir(const Ice::Current &)
NetFS::DirectoryContents list;
int fd = dirfd(od);
while (dirent * d = ::readdir(od)) {
- if (errno) {
- // LCOV_EXCL_START
- throw NetFS::SystemError(errno);
- // LCOV_EXCL_STOP
- }
struct stat s { };
if (::fstatat(fd, d->d_name, &s, AT_SYMLINK_NOFOLLOW) != 0) {
// LCOV_EXCL_START
@@ -57,5 +52,10 @@ DirectoryServer::listdir(const Ice::Current &)
}
list.emplace(d->d_name, convert(s));
}
+ if (errno) {
+ // LCOV_EXCL_START
+ throw NetFS::SystemError(errno);
+ // LCOV_EXCL_STOP
+ }
return list;
}