mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-07 13:35:09 +00:00
Don't scan more than 1024 open file descriptors
This commit is contained in:
@@ -19,8 +19,9 @@ public func printOpenFiles() {
|
||||
var flags: Int32 = 0
|
||||
var fd: Int32 = 0
|
||||
var buf = Data(count: Int(MAXPATHLEN) + 1)
|
||||
let maxFd = min(1024, FD_SETSIZE)
|
||||
|
||||
while fd < FD_SETSIZE {
|
||||
while fd < maxFd {
|
||||
errno = 0;
|
||||
flags = fcntl(fd, F_GETFD, 0);
|
||||
if flags == -1 && errno != 0 {
|
||||
|
||||
Reference in New Issue
Block a user