diff --git a/vm/io.cpp b/vm/io.cpp index d07c1330f4..92dd70791d 100755 --- a/vm/io.cpp +++ b/vm/io.cpp @@ -23,10 +23,8 @@ void factor_vm::init_c_io() void factor_vm::io_error() { -#ifndef WINCE if(errno == EINTR) return; -#endif general_error(ERROR_IO,tag_fixnum(errno),false_object); } @@ -50,7 +48,7 @@ int factor_vm::safe_fgetc(FILE *stream) int c; for(;;) { - c = fgetc(stream); + c = getc(stream); if(c == EOF) { if(feof(stream)) @@ -89,7 +87,7 @@ void factor_vm::safe_fputc(int c, FILE *stream) { for(;;) { - if(fputc(c,stream) == EOF) + if(putc(c,stream) == EOF) io_error(); else break; diff --git a/vm/os-windows.cpp b/vm/os-windows.cpp index a93df114b7..c1d4437773 100755 --- a/vm/os-windows.cpp +++ b/vm/os-windows.cpp @@ -287,15 +287,8 @@ static BOOL WINAPI ctrl_handler(DWORD dwCtrlType) VM we can get. This will not be a good idea when we actually support native threads. */ assert(thread_vms.size() == 1); - THREADHANDLE vm_thread = thread_vms.begin()->first; factor_vm *vm = thread_vms.begin()->second; - - assert(SuspendThread(vm_thread) == 0); - std::cout << "handling ctrl-c" << std::endl; - vm->enqueue_safepoint_fep(); - MemoryBarrier(); - assert(ResumeThread(vm_thread) == 1); return TRUE; } default: