Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2014-01-17 18:17:09 +0400
committerJunio C Hamano <gitster@pobox.com>2014-01-18 00:09:26 +0400
commit7edc02f4deedb3a11abeb328dc2596b2886c2f47 (patch)
treef592d5687516f56552669dd16e34bfbc8d538be1 /streaming.c
parent4224916ae979204f13db2996d9e32490e0acb90f (diff)
prefer xwrite instead of write
Our xwrite wrapper already deals with a few potential hazards, and are as such more robust. Prefer it instead of write to get the robustness benefits everywhere. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Reviewed-and-improved-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'streaming.c')
-rw-r--r--streaming.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/streaming.c b/streaming.c
index debe904523..e3d697b88e 100644
--- a/streaming.c
+++ b/streaming.c
@@ -538,7 +538,7 @@ int stream_blob_to_fd(int fd, unsigned const char *sha1, struct stream_filter *f
goto close_and_exit;
}
if (kept && (lseek(fd, kept - 1, SEEK_CUR) == (off_t) -1 ||
- write(fd, "", 1) != 1))
+ xwrite(fd, "", 1) != 1))
goto close_and_exit;
result = 0;