patch-tools_lvmcmdline_c 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. --- LVM2.2.02.177.orig/tools/lvmcmdline.c 2017-12-18 21:44:35.000000000 +0100
  2. +++ LVM2.2.02.177/tools/lvmcmdline.c 2018-06-07 03:09:58.000000000 +0200
  3. @@ -3093,9 +3093,12 @@ int lvm_split(char *str, int *argc, char
  4. static int _check_standard_fds(void)
  5. {
  6. int err = is_valid_fd(STDERR_FILENO);
  7. + FILE *stdin_stream = stdin;
  8. + FILE *stdout_stream = stdout;
  9. + FILE *stderr_stream = stderr;
  10. if (!is_valid_fd(STDIN_FILENO) &&
  11. - !(stdin = fopen(_PATH_DEVNULL, "r"))) {
  12. + !(stdin_stream = fopen(_PATH_DEVNULL, "r"))) {
  13. if (err)
  14. perror("stdin stream open");
  15. else
  16. @@ -3105,7 +3108,7 @@ static int _check_standard_fds(void)
  17. }
  18. if (!is_valid_fd(STDOUT_FILENO) &&
  19. - !(stdout = fopen(_PATH_DEVNULL, "w"))) {
  20. + !(stdout_stream = fopen(_PATH_DEVNULL, "w"))) {
  21. if (err)
  22. perror("stdout stream open");
  23. /* else no stdout */
  24. @@ -3113,7 +3116,7 @@ static int _check_standard_fds(void)
  25. }
  26. if (!is_valid_fd(STDERR_FILENO) &&
  27. - !(stderr = fopen(_PATH_DEVNULL, "w"))) {
  28. + !(stderr_stream = fopen(_PATH_DEVNULL, "w"))) {
  29. printf("stderr stream open: %s\n",
  30. strerror(errno));
  31. return 0;