blob: adb4c56a13276b40aea07e4954ea7327dd77ab6a [file] [log] [blame]
#include <stdlib.h>
#include <stdio.h>
#include <sys/wait.h>
#include <errno.h>
int
main(int argc, char *argv[])
{
int rv;
if (argc < 2)
return -1;
rv = system(argv[1]);
if (rv < 0) {
fprintf(stderr, "Error calling system(): %d\n", errno);
return 1;
}
printf("Done!\n");
if (WEXITSTATUS(rv) != 0) {
fprintf(stderr, "Command returned non-zero exit code: %d\n",
WEXITSTATUS(rv));
return 1;
}
return 0;
}