File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ pub struct FromEnvError {
1515pub enum FromEnvErrorKind {
1616 /// There is no environment variable that describes jobserver to inherit.
1717 NoEnvVar ,
18- /// There is no jobserver in the environment variable.
18+ /// There is no jobserver in the environment variable, or it was disabled .
1919 /// Variables associated with Make can be used for passing data other than jobserver info.
2020 NoJobserver ,
2121 /// Cannot parse jobserver environment variable value, incorrect format.
Original file line number Diff line number Diff line change @@ -130,6 +130,12 @@ impl Client {
130130 . parse ( )
131131 . map_err ( |e| FromEnvErrorInner :: CannotParse ( format ! ( "cannot parse `write` fd: {e}" ) ) ) ?;
132132
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+
133139 // Ok so we've got two integers that look like file descriptors, but
134140 // for extra sanity checking let's see if they actually look like
135141 // valid files and instances of a pipe if feature enabled before we
You can’t perform that action at this time.
0 commit comments