From 96328398b3803c96f6a91edc39ccebd4bb9dd12c Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Wed, 1 Sep 2021 14:54:41 +0200 Subject: pkt-line: add stdio packet write functions This adds three new functions to pkt-line.c: packet_fwrite, packet_fwrite_fmt and packet_fflush. Besides writing a pktline flush packet, packet_fflush also flushes the stdio buffer of the stream. Helped-by: Patrick Steinhardt Helped-by: Jeff King Signed-off-by: Jacob Vosmaer Signed-off-by: Junio C Hamano --- cache.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index d23de69368..011dac4eb7 100644 --- a/cache.h +++ b/cache.h @@ -1738,6 +1738,8 @@ extern const char *git_mailmap_blob; void maybe_flush_or_die(FILE *, const char *); __attribute__((format (printf, 2, 3))) void fprintf_or_die(FILE *, const char *fmt, ...); +void fwrite_or_die(FILE *f, const void *buf, size_t count); +void fflush_or_die(FILE *f); #define COPY_READ_ERROR (-2) #define COPY_WRITE_ERROR (-3) -- cgit v1.2.3