]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: clean up windows ctrl-handler
authorJoe Groff <arcata@gmail.com>
Thu, 27 Oct 2011 04:40:14 +0000 (21:40 -0700)
committerJoe Groff <arcata@gmail.com>
Fri, 28 Oct 2011 04:18:22 +0000 (21:18 -0700)
vm/io.cpp
vm/os-windows.cpp

index d07c1330f450480c388b4f4fe644f7be19c3e9e9..92dd70791d8bd82a9562940fadd3af1ea1245f24 100755 (executable)
--- 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;
index a93df114b7411276d018601126666d5acd5fbc94..c1d4437773d4ca346f247e3f0ce0866edb174582 100755 (executable)
@@ -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: