File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
stdlib/private/StdlibUnittest Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -670,7 +670,7 @@ func _childProcess() {
670
670
}
671
671
672
672
struct _ParentProcess {
673
- internal var _pid : pid_t = - 1
673
+ internal var _pid : pid_t ? = nil
674
674
internal var _childStdin : _FDOutputStream = _FDOutputStream ( fd: - 1 )
675
675
internal var _childStdout : _FDInputStream = _FDInputStream ( fd: - 1 )
676
676
internal var _childStderr : _FDInputStream = _FDInputStream ( fd: - 1 )
@@ -695,8 +695,8 @@ struct _ParentProcess {
695
695
}
696
696
697
697
mutating func _waitForChild( ) -> ProcessTerminationStatus {
698
- let status = posixWaitpid ( _pid)
699
- _pid = - 1
698
+ let status = posixWaitpid ( _pid! )
699
+ _pid = nil
700
700
_childStdin. close ( )
701
701
_childStdout. close ( )
702
702
_childStderr. close ( )
@@ -757,7 +757,7 @@ struct _ParentProcess {
757
757
) -> ( anyExpectFailed: Bool , seenExpectCrash: Bool ,
758
758
status: ProcessTerminationStatus ? ,
759
759
crashStdout: [ String ] , crashStderr: [ String ] ) {
760
- if _pid <= 0 {
760
+ if _pid == nil {
761
761
_spawnChild ( )
762
762
}
763
763
You can’t perform that action at this time.
0 commit comments