Created
March 9, 2014 21:50
-
-
Save jnthn/9455271 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/io/syncfile.c b/src/io/syncfile.c | |
index 904ab6c..6d32d34 100644 | |
--- a/src/io/syncfile.c | |
+++ b/src/io/syncfile.c | |
@@ -183,8 +183,9 @@ static MVMint64 eof(MVMThreadContext *tc, MVMOSHandle *h) { | |
uv_fs_t req; | |
if (data->ds && !MVM_string_decodestream_is_empty(tc, data->ds)) | |
return 0; | |
- if ((r = uv_fs_lstat(tc->loop, &req, data->filename, NULL)) == -1) | |
- MVM_exception_throw_adhoc(tc, "Failed to stat in filehandle: %d", errno); | |
+ if (data->filename) | |
+ if ((r = uv_fs_lstat(tc->loop, &req, data->filename, NULL)) == -1) | |
+ MVM_exception_throw_adhoc(tc, "Failed to stat in filehandle: %d", errno); | |
if ((seek_pos = MVM_platform_lseek(data->fd, 0, SEEK_CUR)) == -1) | |
MVM_exception_throw_adhoc(tc, "Failed to seek in filehandle: %d", errno); | |
return req.statbuf.st_size == seek_pos; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment