Loading...
--- dyld/dyld-1162/common/FileManager.cpp
+++ dyld/dyld-1066.8/common/FileManager.cpp
@@ -21,10 +21,6 @@
*
* @APPLE_LICENSE_HEADER_END@
*/
-
-#include <TargetConditionals.h>
-
-#if !TARGET_OS_EXCLAVEKIT
#include <fcntl.h>
#include <unistd.h>
@@ -56,9 +52,7 @@
FileRecord FileManager::fileRecordForPath(Allocator& allocator, const char* filePath) {
- const char* str = nullptr;
- if ( filePath )
- str = allocator.strdup(filePath);
+ auto str = allocator.strdup(filePath);
return FileRecord(*this, UniquePtr<const char>(str));
}
@@ -114,13 +108,13 @@
// groups that are not relevent here.
uint64_t f_fsid = (*((uint64_t*)&fsInfos[i].f_fsid)) & 0x00ffffffff;
if (_fsUUIDMap->find(f_fsid) != _fsUUIDMap->end()) { continue; }
-
- // getattrlist() can upcall when used against a non-root volume which results in a deadlock.
+#if TARGET_OS_OSX
+ // On macOS getattrlist() can upcall when used against a non-root volume which results in a deadlock.
if ((fsInfos[i].f_flags & MNT_ROOTFS) == 0) {
_fsUUIDMap->insert({f_fsid, UUID()});
continue;
}
-
+#endif
int err;
attrlist attrList;
VolAttrBuf attrBuf;
@@ -190,13 +184,13 @@
UniquePtr<char> FileManager::getPath(uint64_t fsid, uint64_t OID) {
if ((fsid == 0) || (OID == 0)) { return nullptr; }
- char path[PATH_MAX];
- ssize_t result = this->fsgetpath(&path[0], PATH_MAX, fsid, OID);
+ char path[MAXPATHLEN];
+ ssize_t result = this->fsgetpath(&path[0], MAXPATHLEN, fsid, OID);
#if !__LP64__
//FIXME: Workaround for missing stat high bit on 32 bit platforms
if (result == -1) {
OID = 0x0fffffff00000000ULL | OID;
- result = this->fsgetpath(&path[0], PATH_MAX, fsid, OID);
+ result = this->fsgetpath(&path[0], MAXPATHLEN, fsid, OID);
}
#endif
if (result == -1) {
@@ -383,5 +377,3 @@
}
}; /* namedpace dyld4 */
-
-#endif // !TARGET_OS_EXCLAVEKIT