path.c 364 B

123456789101112131415161718
  1. #include <stdlib.h>
  2. #include <reproc/run.h>
  3. // Redirects the output of the given command to the reproc.out file.
  4. int main(int argc, const char **argv)
  5. {
  6. (void) argc;
  7. int r = reproc_run(argv + 1,
  8. (reproc_options){ .redirect.path = "reproc.out" });
  9. if (r < 0) {
  10. fprintf(stderr, "%s\n", reproc_strerror(r));
  11. }
  12. return abs(r);
  13. }