Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/x.diff Secret

Created June 8, 2017 16:36
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 jnthn/4dec46cd34c6d7cc0c7e025bff124684 to your computer and use it in GitHub Desktop.
Save jnthn/4dec46cd34c6d7cc0c7e025bff124684 to your computer and use it in GitHub Desktop.
diff --git a/src/io/syncfile.c b/src/io/syncfile.c
index 82239ca..9b67b94 100644
--- a/src/io/syncfile.c
+++ b/src/io/syncfile.c
@@ -166,6 +166,8 @@ static MVMint64 write_bytes(MVMThreadContext *tc, MVMOSHandle *h, char *buf, M
/* Flushes the file handle. */
static void flush(MVMThreadContext *tc, MVMOSHandle *h){
MVMIOFileData *data = (MVMIOFileData *)h->body.data;
+ if (isatty(data->fd))
+ return;
if (MVM_platform_fsync(data->fd) == -1)
MVM_exception_throw_adhoc(tc, "Failed to flush filehandle: %s", strerror(errno));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment