summaryrefslogtreecommitdiff
path: root/package/lvm/patches/patch-tools_lvmcmdline_c
blob: 8c5cb5c6b913ec1fda154cd84eaf044a0980ce48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- LVM2.2.02.177.orig/tools/lvmcmdline.c	2017-12-18 21:44:35.000000000 +0100
+++ LVM2.2.02.177/tools/lvmcmdline.c	2018-06-07 03:09:58.000000000 +0200
@@ -3093,9 +3093,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
@@ -3105,7 +3108,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 */
@@ -3113,7 +3116,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;