Skip to content

Commit f50ce7a

Browse files
committed
[gardening] Fix warning about strerror return value
strerror should never return nil, and in the worst case it's already in a fatalError. Fix the warning about converting an optional value to a string.
1 parent 2852ce3 commit f50ce7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/sourcekit-lsp/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ do {
120120
// will not break our connection stream.
121121
let realStdout = dup(STDOUT_FILENO)
122122
if realStdout == -1 {
123-
fatalError("failed to dup stdout: \(strerror(errno))")
123+
fatalError("failed to dup stdout: \(strerror(errno)!)")
124124
}
125125
if dup2(STDERR_FILENO, STDOUT_FILENO) == -1 {
126-
fatalError("failed to redirect stdout -> stderr: \(strerror(errno))")
126+
fatalError("failed to redirect stdout -> stderr: \(strerror(errno)!)")
127127
}
128128

129129
let clientConnection = JSONRPCConnection(

0 commit comments

Comments
 (0)