Separate program running from waiting

Until now run_program2() was a replacement for system() so it always
waited for the process to end before returning. To make this function
more useful move the waiting code into a separate function and add a
mechanism to expect a specific exit code.

Signed-off-by: Andrew Price <anprice@redhat.com>
3 files changed