File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ pub struct FromEnvError {
15
15
pub enum FromEnvErrorKind {
16
16
/// There is no environment variable that describes jobserver to inherit.
17
17
NoEnvVar ,
18
- /// There is no jobserver in the environment variable.
18
+ /// There is no jobserver in the environment variable, or it was disabled .
19
19
/// Variables associated with Make can be used for passing data other than jobserver info.
20
20
NoJobserver ,
21
21
/// Cannot parse jobserver environment variable value, incorrect format.
Original file line number Diff line number Diff line change @@ -130,6 +130,12 @@ impl Client {
130
130
. parse ( )
131
131
. map_err ( |e| FromEnvErrorInner :: CannotParse ( format ! ( "cannot parse `write` fd: {e}" ) ) ) ?;
132
132
133
+ // If either or both of these file descriptors are negative,
134
+ // it means the jobserver is disabled for this process.
135
+ if read < 0 || write < 0 {
136
+ return Err ( FromEnvErrorInner :: NoJobserver ) ;
137
+ }
138
+
133
139
// Ok so we've got two integers that look like file descriptors, but
134
140
// for extra sanity checking let's see if they actually look like
135
141
// valid files and instances of a pipe if feature enabled before we
You can’t perform that action at this time.
0 commit comments