summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-27 02:06:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-27 02:06:35 (GMT)
commit6254330e4d075be1fdbef0349b40562d25157b6e (patch)
tree12f317b1c83aacb14e4c8f306328c9453392b4cc /config.c
parentf70a50fc48e4f3e00120153c68df1acd2a5aa382 (diff)
parentc5e3bc6ec46071397b40582157214d374d1b4fab (diff)
downloadgit-6254330e4d075be1fdbef0349b40562d25157b6e.zip
git-6254330e4d075be1fdbef0349b40562d25157b6e.tar.gz
git-6254330e4d075be1fdbef0349b40562d25157b6e.tar.bz2
Merge branch 'sd/branch-copy'
Code clean-up. * sd/branch-copy: config: avoid "write_in_full(fd, buf, len) != len" pattern
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.c b/config.c
index 03ab56d..731b9b1 100644
--- a/config.c
+++ b/config.c
@@ -2824,7 +2824,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;
}
@@ -2886,7 +2886,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;
}