@@ -62,27 +62,27 @@ public struct StandardIOMessageConnection: MessageConnection {
62
62
// receiving messages from the plugin host.
63
63
let inputFD = dup ( fileno ( _stdin) )
64
64
guard inputFD >= 0 else {
65
- throw IOError . systemError ( function: " dup(fileno(stdin)) " , errno: _errno )
65
+ throw IOError . systemError ( function: " dup(fileno(stdin)) " , errno: _swift_syntax_errno )
66
66
}
67
67
68
68
// Having duplicated the original standard-input descriptor, we close
69
69
// `stdin` so that attempts by the plugin to read console input (which
70
70
// are usually a mistake) return errors instead of blocking.
71
71
guard close ( fileno ( _stdin) ) >= 0 else {
72
- throw IOError . systemError ( function: " close(fileno(stdin)) " , errno: _errno )
72
+ throw IOError . systemError ( function: " close(fileno(stdin)) " , errno: _swift_syntax_errno )
73
73
}
74
74
75
75
// Duplicate the `stdout` file descriptor, which we will then use for
76
76
// sending messages to the plugin host.
77
77
let outputFD = dup ( fileno ( _stdout) )
78
78
guard outputFD >= 0 else {
79
- throw IOError . systemError ( function: " dup(fileno(stdout)) " , errno: _errno )
79
+ throw IOError . systemError ( function: " dup(fileno(stdout)) " , errno: _swift_syntax_errno )
80
80
}
81
81
82
82
// Having duplicated the original standard-output descriptor, redirect
83
83
// `stdout` to `stderr` so that all free-form text output goes there.
84
84
guard dup2 ( fileno ( _stderr) , fileno ( _stdout) ) >= 0 else {
85
- throw IOError . systemError ( function: " dup2(fileno(stderr), fileno(stdout)) " , errno: _errno )
85
+ throw IOError . systemError ( function: " dup2(fileno(stderr), fileno(stdout)) " , errno: _swift_syntax_errno )
86
86
}
87
87
88
88
#if canImport(ucrt)
@@ -101,7 +101,7 @@ public struct StandardIOMessageConnection: MessageConnection {
101
101
let endPtr = ptr. advanced ( by: buffer. count)
102
102
while ptr != endPtr {
103
103
switch write ( outputFileDescriptor, ptr, numericCast ( endPtr - ptr) ) {
104
- case - 1 : throw IOError . systemError ( function: " write(_:_:_:) " , errno: _errno )
104
+ case - 1 : throw IOError . systemError ( function: " write(_:_:_:) " , errno: _swift_syntax_errno )
105
105
case 0 : throw IOError . systemError ( function: " write " , errno: 0 ) /* unreachable */
106
106
case let n: ptr += Int ( n)
107
107
}
@@ -116,7 +116,7 @@ public struct StandardIOMessageConnection: MessageConnection {
116
116
let endPtr = ptr. advanced ( by: buffer. count)
117
117
while ptr != endPtr {
118
118
switch read ( inputFileDescriptor, ptr, numericCast ( endPtr - ptr) ) {
119
- case - 1 : throw IOError . systemError ( function: " read(_:_:_:) " , errno: _errno )
119
+ case - 1 : throw IOError . systemError ( function: " read(_:_:_:) " , errno: _swift_syntax_errno )
120
120
case 0 : throw IOError . readReachedEndOfInput
121
121
case let n: ptr += Int ( n)
122
122
}
0 commit comments