Skip to content

Commit 97137b4

Browse files
committed
Update DebugServer
1 parent ea6759e commit 97137b4

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Sources/OpenGraphCxx/DebugServer/DebugServer.mm

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,13 @@
168168

169169
// Call select with write file descriptors
170170
int select_result = select(max_fd + 1, nullptr, &writefds, nullptr, &tv);
171-
172171
if (select_result <= 0) {
173-
if (*__error() != EAGAIN) {
174-
perror("AGDebugServer: select");
175-
return;
172+
if (errno == EAGAIN) {
173+
// Continue the loop on EAGAIN
174+
continue;
176175
}
177-
// Continue the loop on EAGAIN
178-
continue;
176+
perror("OGDebugServer: select");
177+
return;
179178
}
180179

181180
// Check if server socket is ready for new connections

Tests/OpenGraphCxxTests/DebugServer/DebugServerTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ struct DebugServerTests {
2828
let url = try #require(debugServer.copy_url()) as URL
2929
let components = try #require(URLComponents(url: url, resolvingAgainstBaseURL: false))
3030
let token = try #require(components.queryItems?.first { $0.name == "token" }?.value.flatMap { UInt32($0) })
31-
32-
debugServer.run(3)
31+
debugServer.run(1)
3332
let client = DebugClient()
3433
try await client.connect(to: url)
3534

0 commit comments

Comments
 (0)