Thread (132 messages) 132 messages, 8 authors, 2021-03-22

[PATCH 01/10] pkt-line: use stack rather than static buffer in packet_write_gently()

flat view
STALE2046d

From: Jeff Hostetler via GitGitGadget <hidden>
Date: 2021-01-12 15:32:33
Subsystem: the rest · Maintainer: Linus Torvalds

From: Jeff Hostetler <redacted>

Teach packet_write_gently() to use a stack buffer rather than a static
buffer when composing the packet line message.  This helps get us ready
for threaded operations.

Signed-off-by: Jeff Hostetler <redacted>
---
 pkt-line.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkt-line.c b/pkt-line.c
index d633005ef74..98439a2fed0 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -196,7 +196,7 @@ int packet_write_fmt_gently(int fd, const char *fmt, ...)
 
 static int packet_write_gently(const int fd_out, const char *buf, size_t size)
 {
-	static char packet_write_buffer[LARGE_PACKET_MAX];
+	char packet_write_buffer[LARGE_PACKET_MAX];
 	size_t packet_size;
 
 	if (size > sizeof(packet_write_buffer) - 4)
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help