aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar John Keeping <john@keeping.me.uk>2013-05-18 23:57:03 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2013-05-22 19:53:06 (JST)
commit1fec7cd6f817e52a6e55458d584a7a5092ba6aed (patch)
tree6b9415b975dbc7e8424b43ab9ebbcd878270e518
parent927060c5d8d82a9422fc1dcf6d1379d21071b158 (diff)
downloadcgit-1fec7cd6f817e52a6e55458d584a7a5092ba6aed.zip
cgit-1fec7cd6f817e52a6e55458d584a7a5092ba6aed.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/html.c b/html.c
index f7772dc..03277db 100644
--- a/html.c
+++ b/html.c
@@ -78,7 +78,7 @@ char *fmtalloc(const char *format, ...)
78void html_raw(const char *data, size_t size) 78void html_raw(const char *data, size_t size)
79{ 79{
80 if (write(htmlfd, data, size) != size) 80 if (write(htmlfd, data, size) != size)
81 fprintf(stderr, "[html.c] html output truncated.\n"); 81 die_errno("write error on html output");
82} 82}
83 83
84void html(const char *txt) 84void html(const char *txt)