Skip to content

Commit a45dc59

Browse files
committed
return unit
1 parent ddf5406 commit a45dc59

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

io/native/src/main/scala/fs2/io/process/ProcessesPlatform.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)