summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-12-06 09:09:01 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-12-06 09:09:01 -0800
commit74d6c9de9b89e56e641aff840b15e4a8fb291638 (patch)
tree7a1f87556470c4152511661fe97bb0d4c096ffc7
parentMerge branch 'sw/pull-ipv46-passthru' into maint (diff)
parentconfig: avoid "write_in_full(fd, buf, len) != len" pattern (diff)
downloadtgif-74d6c9de9b89e56e641aff840b15e4a8fb291638.tar.xz
Merge branch 'sd/branch-copy' into maint
Code clean-up. * sd/branch-copy: config: avoid "write_in_full(fd, buf, len) != len" pattern
-rw-r--r--config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.c b/config.c
index c38401a750..41862d4a32 100644
--- a/config.c
+++ b/config.c
@@ -2811,7 +2811,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
* multiple [branch "$name"] sections.
*/
if (copystr.len > 0) {
- if (write_in_full(out_fd, copystr.buf, copystr.len) != copystr.len) {
+ if (write_in_full(out_fd, copystr.buf, copystr.len) < 0) {
ret = write_error(get_lock_file_path(lock));
goto out;
}
@@ -2873,7 +2873,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
* logic in the loop above.
*/
if (copystr.len > 0) {
- if (write_in_full(out_fd, copystr.buf, copystr.len) != copystr.len) {
+ if (write_in_full(out_fd, copystr.buf, copystr.len) < 0) {
ret = write_error(get_lock_file_path(lock));
goto out;
}