4 * This is just a quick little hack to start a program and automatically
5 * restart it if it exits with a nonzero exit status.
12 #include <sys/types.h>
17 int main(int argc, char **argv)
33 else if (child == 0) {
34 exit(execvp(argv[0], &argv[0]));
38 printf("%s: started. pid = %d\n", argv[0], child);
39 waitpid(child, &status, 0);
40 printf("Exit code %d\n", status);
43 } while (status != 0);