Skip to content

Commit 782c030

Browse files
rscharfegitster
authored andcommitted
config: flip return value of write_section()
d9bd4cb (config: flip return value of store_write_*()) made write_section() follow the convention of write(2) to return -1 on error and the number of written bytes on success. 3b48045 (Merge branch 'sd/branch-copy') changed it back to returning 0 on error and 1 on success, but left its callers still checking for negative values. Let write_section() follow the convention of write(2) again to meet the expectations of its callers. Reported-by: Jeff King <[email protected]> Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3b48045 commit 782c030

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,7 @@ static ssize_t write_section(int fd, const char *key)
23192319
struct strbuf sb = store_create_section(key);
23202320
ssize_t ret;
23212321

2322-
ret = write_in_full(fd, sb.buf, sb.len) == sb.len;
2322+
ret = write_in_full(fd, sb.buf, sb.len);
23232323
strbuf_release(&sb);
23242324

23252325
return ret;

0 commit comments

Comments
 (0)