Checkpoint: Job Runner
Challenge on lesson: Checkpoint: Job Runner
CHALLENGE
Difficulty: advanced+25 XP
One program over the module's machinery. Given run_capture(cmd) (runs /bin/sh -c cmd, discards output, returns the exit code). Implement size_t run_sequence(const char *const *cmds, size_t n, int *codes) โ run each command in order, store its exit code in codes[i], and return the number of failing commands (nonzero exit). NULL cmds with n>0 returns (size_t)-1 without touching codes.
Press Submit to check your solution.
Back to lesson: Checkpoint: Job Runner