Skip to contentSkip to conversation

network/netstress: fix stdout/stderr log file flags and mode

PATCH New Alexey Kodanev 2 participants 2 messages Aug 27, 2021 – Sep 9, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 network/netstress: fix stdout/stderr log file flags and mode

* fix access mode for stdout/stderr

* add a write bit to the mode so that the next time the server starts, it doesn't fail with EACCES because the log file already exists and has read-only permissions.

---
 testcases/network/netstress/netstress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/network/netstress/netstress.c +1 -1
index c46bc86c3..03b1563dc 100644
@@ -723,7 +723,7 @@ static void move_to_background(void)
 	close(STDOUT_FILENO);
 	close(STDERR_FILENO);
 
-	int fd = SAFE_OPEN(log_path, O_CREAT | O_TRUNC | O_RDONLY, 00444);
+	int fd = SAFE_OPEN(log_path, O_CREAT | O_TRUNC | O_WRONLY, 0644);
 
 	SAFE_DUP(fd);
 }
Signature · 1 line
2.25.1