| 395 | #endif |
| 396 | |
| 397 | int cbm_subprocess_run(const cbm_proc_opts_t *opts, cbm_proc_result_t *out) { |
| 398 | cbm_proc_result_t local; |
| 399 | if (!out) { |
| 400 | out = &local; |
| 401 | } |
| 402 | out->outcome = CBM_PROC_SPAWN_FAILED; |
| 403 | out->exit_code = -1; |
| 404 | out->term_signal = 0; |
| 405 | if (!opts || !opts->bin || !opts->bin[0]) { |
| 406 | return -1; |
| 407 | } |
| 408 | #ifdef _WIN32 |
| 409 | return cbm_run_win(opts, out); |
| 410 | #else |
| 411 | return cbm_run_posix(opts, out); |
| 412 | #endif |
| 413 | } |