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 {
7474 }
7575
7676 @ inline private def closeAll (fds : Int * ): Unit =
77- fds.foreach( fd => if (fd >= 0 ) close(fd))
77+ fds.foreach { fd => close (fd); () }
7878
7979 def forAsync [F [_]: LiftIO ](implicit F : Async [F ]): Processes [F ] =
8080 if (LinktimeInfo .isMac || LinktimeInfo .isLinux) {
@@ -134,8 +134,11 @@ private[process] trait ProcessesCompanionPlatform extends Processesjvmnative {
134134 closeAll(stdinPipe(0 ), stdoutPipe(1 ), stderrPipe(1 ))
135135
136136 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+ }
139142 }
140143
141144 execve(toCString(executable), argv, envp)
You can’t perform that action at this time.
0 commit comments