unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 34440836e230f052a2767f9a32d31c63888fc018 1064 bytes (raw)
name: gnu/packages/patches/netcat-openbsd-serialized-handling-multiple-clients.patch 	 # note: path name is non-authoritative(*)

 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
From: Aron Xu <aron@debian.org>
Date: Tue, 14 Feb 2012 23:02:00 +0800
Subject: serialized handling multiple clients

---
 netcat.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

--- a/netcat.c
+++ b/netcat.c
@@ -707,7 +707,10 @@ main(int argc, char *argv[])
 				s = unix_bind(host, 0);
 			else
 				s = unix_listen(host);
-		}
+		} else
+			s = local_listen(host, uport, hints);
+		if (s < 0)
+			err(1, NULL);
 
 # if defined(TLS)
 		if (usetls) {
@@ -721,13 +724,6 @@ main(int argc, char *argv[])
 # endif
 		/* Allow only one connection at a time, but stay alive. */
 		for (;;) {
-			if (family != AF_UNIX) {
-				if (s != -1)
-					close(s);
-				s = local_listen(host, uport, hints);
-			}
-			if (s < 0)
-				err(1, NULL);
 			if (uflag && kflag) {
 				/*
 				 * For UDP and -k, don't connect the socket,
@@ -804,8 +800,11 @@ main(int argc, char *argv[])
 					err(1, "connect");
 			}
 
-			if (!kflag)
+			if (!kflag) {
+				if (s != -1)
+					close(s);
 				break;
+			}
 		}
 	} else if (family == AF_UNIX) {
 		ret = 0;

debug log:

solving 34440836e2 ...
found 34440836e2 in https://yhetil.org/guix-patches/3dfac477-b081-49f4-86b3-2c142bb39f6b@www.fastmail.com/

applying [1/1] https://yhetil.org/guix-patches/3dfac477-b081-49f4-86b3-2c142bb39f6b@www.fastmail.com/
diff --git a/gnu/packages/patches/netcat-openbsd-serialized-handling-multiple-clients.patch b/gnu/packages/patches/netcat-openbsd-serialized-handling-multiple-clients.patch
new file mode 100644
index 0000000000..34440836e2

1:18: space before tab in indent.
 				s = unix_bind(host, 0);
1:19: space before tab in indent.
 			else
1:20: space before tab in indent.
 				s = unix_listen(host);
1:26: trailing whitespace.
 
1:28: space before tab in indent.
 		if (usetls) {
Checking patch gnu/packages/patches/netcat-openbsd-serialized-handling-multiple-clients.patch...
Applied patch gnu/packages/patches/netcat-openbsd-serialized-handling-multiple-clients.patch cleanly.
warning: squelched 12 whitespace errors
warning: 17 lines add whitespace errors.

index at:
100644 34440836e230f052a2767f9a32d31c63888fc018	gnu/packages/patches/netcat-openbsd-serialized-handling-multiple-clients.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).