The caller is already prepared to handle errors returned from this
function so there is no need for it to die if it cannot read the file.
Suggested-by: Eric Sunshine <redacted>
Signed-off-by: Phillip Wood <redacted>
Signed-off-by: Junio C Hamano <redacted>
if (fd < 0) {
if (errno == ENOENT)
return 0;
- die_errno(_("could not open '%s' for reading"), filename);
+ return error_errno(_("could not open '%s' for reading"),
+ filename);
}
strbuf_read(&buf, fd, 0);
close(fd);