aboutsummaryrefslogtreecommitdiff
path: root/net/tmate/patches/010-Avoid-initializing-stdout-twice.patch
blob: ca2d7030df456bf3c9249be0ddaeea716e60786f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From 9e3e39d66ddb4a610720fa37a5683c846d2a1ba6 Mon Sep 17 00:00:00 2001
From: Nicolas Viennot <nicolas@viennot.biz>
Date: Wed, 11 Mar 2020 11:30:33 -0400
Subject: [PATCH] Avoid initializing stdout twice

Closes #190
---
 log.c | 3 +++
 1 file changed, 3 insertions(+)

--- a/log.c
+++ b/log.c
@@ -61,6 +61,9 @@ log_get_level(void)
 void
 log_open_fp(FILE *f)
 {
+	if (log_file == f)
+		return;
+
 	if (log_file != NULL && !is_log_stdout())
 		fclose(log_file);