=== src/embed.c ================================================================== --- src/embed.c (revision 36588) +++ src/embed.c (local) @@ -440,9 +440,9 @@ #endif /* if we've opened a file (or stdin) with PIO, read it in */ if (io) { + char *cursor; size_t chunk_size = program_size > 0 ? program_size : 1024; INTVAL wanted = program_size; - char *cursor; size_t read_result; program_code = (char *)mem_sys_allocate(chunk_size); @@ -461,6 +461,7 @@ Parrot_io_eprintf(interp, "Parrot VM: Could not reallocate buffer " "while reading packfile from PIO.\n"); + fclose(io); return NULL; } =item C === t/pmc/eval.t ================================================================== --- t/pmc/eval.t (revision 36588) +++ t/pmc/eval.t (local) @@ -1,5 +1,5 @@ #! perl -# Copyright (C) 2001-2008, The Perl Foundation. +# Copyright (C) 2001-2009, The Perl Foundation. # $Id$ use strict; @@ -316,11 +316,11 @@ 2 1 1 1 OUTPUT -TODO: { - local $TODO = "cannot 'rm' an open file on windows. TT#121" if $^O =~ /(MSWin32|cygwin)/; +(my $fh, $temp_pbc) = create_tempfile( SUFFIX => '.pbc', UNLINK => 1 ); +close $fh; + pir_output_is( <<"CODE", <<'OUTPUT', "eval.get_string - same file" ); .sub main :main - .local pmc f1, f2 .local pmc io, os f1 = compi("foo_1", "hello from foo_1") @@ -358,7 +358,6 @@ CODE hello from foo_1 OUTPUT -} my (undef, $temp_file) = create_tempfile( UNLINK => 1 );