diff --git a/CommandListener.cpp b/CommandListener.cpp index dff4625..f26f6a1 100644 --- a/CommandListener.cpp +++ b/CommandListener.cpp @@ -270,7 +270,7 @@ void CommandListener::AsecCmd::listAsecsInDirectory(SocketClient *cli, const cha } size_t dirent_len = offsetof(struct dirent, d_name) + - pathconf(directory, _PC_NAME_MAX) + 1; + fpathconf(dirfd(d), _PC_NAME_MAX) + 1; struct dirent *dent = (struct dirent *) malloc(dirent_len); if (dent == NULL) { diff --git a/VolumeManager.cpp b/VolumeManager.cpp index 957d06b..bdc7739 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -1471,7 +1471,7 @@ int VolumeManager::unmountAllAsecsInDir(const char *directory) { } size_t dirent_len = offsetof(struct dirent, d_name) + - pathconf(directory, _PC_NAME_MAX) + 1; + fpathconf(dirfd(d), _PC_NAME_MAX) + 1; struct dirent *dent = (struct dirent *) malloc(dirent_len); if (dent == NULL) {