Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Add configuration option for default untracked files mode
[gitweb.git]
/
write_or_die.c
diff --git
a/write_or_die.c
b/write_or_die.c
index 32f99140205f8969d8a884b3cf9448eec3f1dd16..630be4cb9414b1686a5ad86a4d5166f2828096f1 100644
(file)
--- a/
write_or_die.c
+++ b/
write_or_die.c
@@
-78,6
+78,13
@@
ssize_t write_in_full(int fd, const void *buf, size_t count)
return total;
}
+void fsync_or_die(int fd, const char *msg)
+{
+ if (fsync(fd) < 0) {
+ die("%s: fsync error (%s)", msg, strerror(errno));
+ }
+}
+
void write_or_die(int fd, const void *buf, size_t count)
{
if (write_in_full(fd, buf, count) < 0) {