patch-tools_lvmcmdline_c 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. --- LVM2.2.02.106.orig/tools/lvmcmdline.c 2014-04-10 17:38:46.000000000 +0200
  2. +++ LVM2.2.02.106/tools/lvmcmdline.c 2014-05-29 16:57:14.221581766 +0200
  3. @@ -1252,9 +1252,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. @@ -1264,7 +1267,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. @@ -1272,7 +1275,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;