SubmittingPatches: explain rationale for using --notes with format-patch
[gitweb.git] / write_or_die.c
index b50f99a9361926d2116c85e3e90a132fb9dab742..e7afe7a295e586d58313e82e87b22de347aef7a1 100644 (file)
@@ -49,6 +49,21 @@ void maybe_flush_or_die(FILE *f, const char *desc)
        }
 }
 
+void fprintf_or_die(FILE *f, const char *fmt, ...)
+{
+       va_list ap;
+       int ret;
+
+       va_start(ap, fmt);
+       ret = vfprintf(f, fmt, ap);
+       va_end(ap);
+
+       if (ret < 0) {
+               check_pipe(errno);
+               die_errno("write error");
+       }
+}
+
 void fsync_or_die(int fd, const char *msg)
 {
        if (fsync(fd) < 0) {