* [PATCH 4/3] git-http-backend: avoid multi-arg print statemtents
@ 2016-02-25 4:39 7% ` Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2016-02-25 4:39 UTC (permalink / raw)
To: meta
Even with output buffering disabled via IO::Handle::autoflush,
writes are not atomic unless it is a single argument passed to
"print". Multiple arguments to "print" will show up as multiple
calls to write(2) instead of a single, atomic writev(2).
---
lib/PublicInbox/GitHTTPBackend.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm
index 9c32535..5879970 100644
--- a/lib/PublicInbox/GitHTTPBackend.pm
+++ b/lib/PublicInbox/GitHTTPBackend.pm
@@ -139,7 +139,7 @@ sub serve_smart {
while (1) {
my $r = $input->read($buf, 8192);
unless (defined $r) {
- $err->print('error reading input: ', $!, "\n");
+ $err->print("error reading input: $!\n");
return r(500);
}
last if ($r == 0);
@@ -150,12 +150,12 @@ sub serve_smart {
}
my ($rpipe, $wpipe);
unless (pipe($rpipe, $wpipe)) {
- $err->print('error creating pipe', $!, "\n");
+ $err->print("error creating pipe: $!\n");
return r(500);
}
my $pid = fork; # TODO: vfork under Linux...
unless (defined $pid) {
- $err->print('error forking: ', $!, "\n");
+ $err->print("error forking: $!\n");
return r(500);
}
my $git_dir = $git->{git_dir};
--
EW
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-02-25 4:02 [PATCH 0/3] migrate git-http-backend to async use Eric Wong
2016-02-25 4:39 7% ` [PATCH 4/3] git-http-backend: avoid multi-arg print statemtents Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.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).