check_run.patch 812 B

123456789101112131415161718192021222324252627
  1. --- check_run.c.orig 2020-01-12 03:06:59.992434700 +0100
  2. +++ check_run.c.new 2020-01-12 04:40:42.224635800 +0100
  3. @@ -28,6 +28,8 @@
  4. #include <stdarg.h>
  5. #include <signal.h>
  6. #include <setjmp.h>
  7. +#include <sys/stat.h>
  8. +#include <fcntl.h>
  9. #include "check.h"
  10. #include "check_error.h"
  11. @@ -486,6 +488,15 @@
  12. eprintf("Error in call to fork:", __FILE__, __LINE__ - 2);
  13. if(pid == 0)
  14. {
  15. +char fn[256];
  16. +int fd1, fd2;
  17. +sprintf(fn, "%s.stdout", srunner_log_fname(sr));
  18. +fd1 = open(fn, O_WRONLY|O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
  19. +dup2(fd1, 1);
  20. +sprintf(fn, "%s.stderr", srunner_log_fname(sr));
  21. +fd2 = open(fn, O_WRONLY|O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
  22. +dup2(fd2, 2);
  23. +
  24. setpgid(0, 0);
  25. group_pid = getpgrp();
  26. tr = tcase_run_checked_setup(sr, tc);