Skip to content

Adapt termination related functions as they return an exit status instead of an exit code

- Feature: add `exitCodeIn` returning the exit code of a terminated process given an `ExitStatus`.
- Feature: add `signalIn` returning the number of the signal that caused the process to terminate, if applicable.
- Feature: add `hadCoreDump` returning if the terminated process produced a coredump.
- Change: `terminate` now returns an `ExitStatus` instead of an `Int`.
- Change: `terminateBySubProcessId` now returns an `ExitStatus` instead of an `Int`.
- Change: `waitForSubProcessToTerminate` now returns an `ExitStatus` instead of an `Int`.
- Change: `waitForNextSubProcessToTerminate` now returns an `ExitStatus` instead of an `Int`.
- Change: `waitForSubProcessToTerminateById` now returns an `ExitStatus` instead of an `Int`.
- Change: `checkIfSubProcessTerminated` now returns an `ExitStatus` instead of an `Int`.
- Change: `checkIfAnySubProcessTerminated` now returns an `ExitStatus` instead of an `Int`.
- Change: `checkIfSubProcessTerminatedById` now returns an `ExitStatus` instead of an `Int`.

To update, whenever using a function which returns an ExitStatus instead of an exitcode, when checking on the exit code, use exitCodeIn exitStatus instead.

E.g:

# (Ok exitcode, env) = waitForSubProcessToTerminateById ... env
| exitCode <> 0 = abort "x"

becomes:

# (Ok exitStatus, env) = waitForSubProcessToTerminateById ... env
| exitCodeIn exitStatus <> 0 = abort "x"
Edited by Gijs Alberts

Merge request reports

Loading