--- LVM2.2.02.114.orig/tools/lvmcmdline.c	2014-11-29 00:07:43.000000000 +0100
+++ LVM2.2.02.114/tools/lvmcmdline.c	2015-02-28 09:27:09.000000000 +0100
@@ -1536,9 +1536,12 @@ int lvm_split(char *str, int *argc, char
 static int _check_standard_fds(void)
 {
 	int err = is_valid_fd(STDERR_FILENO);
+	FILE *stdin_stream = stdin;
+	FILE *stdout_stream = stdout;
+	FILE *stderr_stream = stderr;
 
 	if (!is_valid_fd(STDIN_FILENO) &&
-	    !(stdin = fopen(_PATH_DEVNULL, "r"))) {
+	    !(stdin_stream = fopen(_PATH_DEVNULL, "r"))) {
 		if (err)
 			perror("stdin stream open");
 		else
@@ -1548,7 +1551,7 @@ static int _check_standard_fds(void)
 	}
 
 	if (!is_valid_fd(STDOUT_FILENO) &&
-	    !(stdout = fopen(_PATH_DEVNULL, "w"))) {
+	    !(stdout_stream = fopen(_PATH_DEVNULL, "w"))) {
 		if (err)
 			perror("stdout stream open");
 		/* else no stdout */
@@ -1556,7 +1559,7 @@ static int _check_standard_fds(void)
 	}
 
 	if (!is_valid_fd(STDERR_FILENO) &&
-	    !(stderr = fopen(_PATH_DEVNULL, "w"))) {
+	    !(stderr_stream = fopen(_PATH_DEVNULL, "w"))) {
 		printf("stderr stream open: %s\n",
 		       strerror(errno));
 		return 0;
