Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created March 9, 2014 21:50
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/9455271 to your computer and use it in GitHub Desktop.
Save jnthn/9455271 to your computer and use it in GitHub Desktop.
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