File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
io/native/src/main/scala/fs2/io/process Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ private[process] trait ProcessesCompanionPlatform extends Processesjvmnative {
74
74
}
75
75
76
76
@ inline private def closeAll (fds : Int * ): Unit =
77
- fds.foreach( fd => if (fd >= 0 ) close(fd))
77
+ fds.foreach { fd => close (fd); () }
78
78
79
79
def forAsync [F [_]: LiftIO ](implicit F : Async [F ]): Processes [F ] =
80
80
if (LinktimeInfo .isMac || LinktimeInfo .isLinux) {
@@ -134,8 +134,11 @@ private[process] trait ProcessesCompanionPlatform extends Processesjvmnative {
134
134
closeAll(stdinPipe(0 ), stdoutPipe(1 ), stderrPipe(1 ))
135
135
136
136
process.workingDirectory.foreach { dir =>
137
- if ((dir != null ) && (dir.toString != " ." ))
138
- chdir(toCString(dir.toString))
137
+ if ((dir != null ) && (dir.toString != " ." )) {
138
+ val ret = chdir(toCString(dir.toString))
139
+ if (ret != 0 )
140
+ throw new IOException (s " Failed to chdir to ${dir.toString}" )
141
+ }
139
142
}
140
143
141
144
execve(toCString(executable), argv, envp)
You can’t perform that action at this time.
0 commit comments