diff options
author | John Keeping <john@keeping.me.uk> | 2013-05-18 15:57:03 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-05-18 17:23:49 +0200 |
commit | 5e7fb48b884e13b9878488e94f15cb9de5897664 (patch) | |
tree | a97a57266a04fd5d2ea5f42c49547f7e9e1a9c9e | |
parent | 5e4837296e65e2af1ac63d0992a57e12e916f637 (diff) | |
download | cgit-5e7fb48b884e13b9878488e94f15cb9de5897664.tar.gz |
html.c: die when write fails
If we fail to write HTML output once, there's no point carrying on so
just write a failure message once and die. By using Git's die_errno
function we also let the user know in what way the write failed.
Signed-off-by: John Keeping <john@keeping.me.uk>
-rw-r--r-- | html.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -78,7 +78,7 @@ char *fmtalloc(const char *format, ...) void html_raw(const char *data, size_t size) { if (write(htmlfd, data, size) != size) - fprintf(stderr, "[html.c] html output truncated.\n"); + die_errno("write error on html output"); } void html(const char *txt) |