File: 04-fix-stdin-stdout.patch

package info (click to toggle)
httptunnel 3.3%2Bdfsg-6
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,500 kB
  • sloc: ansic: 4,754; makefile: 26; sh: 4
file content (24 lines) | stat: -rw-r--r-- 740 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Teemu Hukkanen <tjhukkan@iki.fi>
Date: Sat, 16 Mar 2024 16:04:36 +0200
Subject: Fix stdin-stdout option

Origin: upstream
Bug-Debian: http://bugs.debian.org/429885
Forwarded: not-needed
---
 common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common.c b/common.c
index 4256af9..3c48faa 100644
--- a/common.c
+++ b/common.c
@@ -314,7 +314,7 @@ log_annoying ("handle_tunnel_input: tunnel_read() = %d\n", n);
 
       /* If fd == 0, then we are using --stdin-stdout so write to stdout,
        * not fd. */
-      m = write_all (fd ? fd : 0, buf, (size_t)n);
+      m = write_all (fd ? fd : 1, buf, (size_t)n);
       log_annoying ("write_all (%d, %p, %d) = %d", fd ? fd : 1, buf, n, m);
       return m;
     }