Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yamakuzure/28bbae8ed389b097910bc9b7cbb005da to your computer and use it in GitHub Desktop.
Save Yamakuzure/28bbae8ed389b097910bc9b7cbb005da to your computer and use it in GitHub Desktop.
diff --git a/src/basic/fileio.c b/src/basic/fileio.c
index e981cd024..995c30e1f 100644
--- a/src/basic/fileio.c
+++ b/src/basic/fileio.c
@@ -60,12 +60,14 @@ int write_string_stream_ts(
if (fputc('\n', f) == EOF)
return -errno;
- if (flags & WRITE_STRING_FILE_SYNC)
- r = fflush_sync_and_check(f);
- else
- r = fflush_and_check(f);
- if (r < 0)
- return r;
+ if (!(flags & WRITE_STRING_FILE_DISABLE_BUFFER)) {
+ if (flags & WRITE_STRING_FILE_SYNC)
+ r = fflush_sync_and_check(f);
+ else
+ r = fflush_and_check(f);
+ if (r < 0)
+ return r;
+ }
if (ts) {
struct timespec twice[2] = {*ts, *ts};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment