git/write-or-die.c

#include "git-compat-util.h"
#include "parse.h"
#include "run-command.h"
#include "write-or-die.h"

/*
 * Some cases use stdio, but want to flush after the write
 * to get error handling (and to get better interactive
 * behaviour - not buffering excessively).
 *
 * Of course, if the flush happened within the write itself,
 * we've already lost the error code, and cannot report it any
 * more. So we just ignore that case instead (and hope we get
 * the right error code on the flush).
 *
 * If the file handle is stdout, and stdout is a file, then skip the
 * flush entirely since it's not needed.
 */
void maybe_flush_or_die(FILE *f, const char *desc)
{}

void fprintf_or_die(FILE *f, const char *fmt, ...)
{}

static int maybe_fsync(int fd)
{}

void fsync_or_die(int fd, const char *msg)
{}

int fsync_component(enum fsync_component component, int fd)
{}

void fsync_component_or_die(enum fsync_component component, int fd, const char *msg)
{}

void write_or_die(int fd, const void *buf, size_t count)
{}

void fwrite_or_die(FILE *f, const void *buf, size_t count)
{}

void fflush_or_die(FILE *f)
{}