Skip to content

Commit 6bbed12

Browse files
committed
IO: remove fast path of ffPathExists, which causes too many problems
Fix #1662
1 parent f048518 commit 6bbed12

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/common/io/io.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ static inline bool ffPathExists(const char* path, FFPathType pathType)
119119
}
120120
else
121121
{
122-
#if (__APPLE__ || __HAIKU__) // #1395
123122
struct stat fileStat;
124123
if(stat(path, &fileStat) != 0)
125124
return false;
@@ -131,24 +130,6 @@ static inline bool ffPathExists(const char* path, FFPathType pathType)
131130

132131
if(pathType & FF_PATHTYPE_DIRECTORY && mode == S_IFDIR)
133132
return true;
134-
#else
135-
size_t len = strlen(path);
136-
assert(len < PATH_MAX);
137-
if (len == 0) return false;
138-
139-
int ret;
140-
if (path[len - 1] != '/')
141-
{
142-
char buf[PATH_MAX + 1];
143-
memcpy(buf, path, len);
144-
buf[len] = '/';
145-
buf[len + 1] = 0;
146-
ret = access(buf, F_OK);
147-
}
148-
else
149-
ret = access(path, F_OK);
150-
return pathType == FF_PATHTYPE_DIRECTORY ? ret == 0 : ret == -1 && errno == ENOTDIR;
151-
#endif
152133
}
153134

154135
#endif

0 commit comments

Comments
 (0)