]> gitweb.factorcode.org Git - factor.git/commitdiff
fix for socket closing
authorSlava Pestov <slava@factorcode.org>
Mon, 23 Aug 2004 22:46:46 +0000 (22:46 +0000)
committerSlava Pestov <slava@factorcode.org>
Mon, 23 Aug 2004 22:46:46 +0000 (22:46 +0000)
TODO.FACTOR.txt
library/platform/jvm/init.factor
library/platform/native/boot-stage2.factor
library/platform/native/boot.factor
library/platform/native/unparser.factor
native/io.c
native/run.c
native/write.c

index aa4050f0f3d11343633b57d8b82b3ff459a11917..6797f305f183f4ba76e6438ec8b33e9f14a42be0 100644 (file)
@@ -1,12 +1,3 @@
-- plugin should not exit jEdit on fatal errors\r
-- auto insert USE:\r
-- add a socket timeout\r
-- don't allow multiple reads on the same port\r
-- multiple tasks should be able to write to the same port\r
-- jvm factor -- still supporting httpd?\r
-- make inferior.factor nicer to use\r
-- telnetd printing signal 13, and other problems\r
-\r
 + docs:\r
 \r
 - unparse examples\r
@@ -24,6 +15,9 @@
 \r
 + listener/plugin:\r
 \r
+- plugin should not exit jEdit on fatal errors\r
+- make inferior.factor nicer to use\r
+- auto insert USE:\r
 - balance needs USE:\r
 - fedit broken with listener\r
 - maple-like: press enter at old commands to evaluate there\r
@@ -36,6 +30,9 @@
 \r
 + native:\r
 \r
+- add a socket timeout\r
+- don't allow multiple reads on the same port\r
+- multiple tasks should be able to write to the same port\r
 - is the profiler using correct stack depth?\r
 - bignums\r
 - >lower, >upper for strings\r
@@ -43,7 +40,6 @@
 - telnetd and httpd should use multitasking\r
 - sbuf-hashcode\r
 - vector-hashcode\r
-- clarify suspend -vs- yield - toplevel\r
 - irc: stack underflow?\r
 - ignore SIGPIPE\r
 - accept multi-line input in listener\r
@@ -65,6 +61,8 @@
 \r
 + misc:\r
 \r
+- jvm factor -- still supporting httpd?\r
+- dissolve builtins vocabulary\r
 - ifte* combinator\r
 - 'cascading' styles\r
 - jedit ==> jedit-word, jedit takes a file name\r
index 2125a0c21944f3fc51dfd3ac4c9a66e21f4fb939..9c84841413267e1a027a10d5b02422ad04bd1bb6 100644 (file)
@@ -61,6 +61,8 @@ USE: words
     #! The boot word is run by the intepreter when starting from
     #! an object database.
 
+    10 "base" set
+
     ! Some flags are *on* by default, unless user specifies
     ! -no-<flag> CLI switch
     t "user-init" set
index 38139df60e66f56449a2b8f9be4fe06041e3416f..03ad5eb760eebcc4d088704a71ed94c779e1ab50 100644 (file)
@@ -71,8 +71,9 @@ USE: stdio
     "/library/platform/native/parser.factor"
     "/library/platform/native/parse-syntax.factor"
     "/library/platform/native/parse-stream.factor"
-    "/library/platform/native/unparser.factor"
 
+    "/library/format.factor"
+    "/library/platform/native/unparser.factor"
     "/library/styles.factor"
     "/library/vocabulary-style.factor"
     "/library/prettyprint.factor"
index c59fc8f2556f13339c5fe71cf04ca9ea11f97ce8..bd432d62fcd399436230020fefc4116fadd7b202 100644 (file)
@@ -66,8 +66,6 @@ primitives,
     "/library/platform/native/parser.factor"
     "/library/platform/native/parse-syntax.factor"
     "/library/platform/native/parse-stream.factor"
-    "/library/format.factor"
-    "/library/platform/native/unparser.factor"
     "/library/platform/native/init.factor"
 ] [
     cross-compile-resource
index 0ba07c9d7df6aed6249ecf286b1cbf0ad8839883..46eb95fa572fedffeb391a762bb390c61abd29da 100644 (file)
@@ -69,6 +69,8 @@ USE: words
     #! Convert an integer to its hexadecimal representation.
     16 >base ;
 
+DEFER: unparse
+
 : unparse-ratio ( num -- str )
     <% dup
     numerator unparse %
index 52efb1694bf7d1c04852c8b0cea7b22d043cbcef..4d9eb02aa8e087307961fab3beb2ad45c730c157 100644 (file)
@@ -17,6 +17,8 @@ void init_io(void)
        userenv[STDIN_ENV]  = tag_object(port(PORT_READ,0));
        userenv[STDOUT_ENV] = tag_object(port(PORT_WRITE,1));
        
+       /* debug_fd = fdopen(3,"w"); */
+
        read_fd_count = 0;
        init_io_tasks(&read_fd_set,read_io_tasks);
 
index 1ed97fa9c1a1bdaaa40dc207e453b48575483766..19836cb7f98e496480a19bba37eb7ccaa015df8f 100644 (file)
@@ -25,15 +25,17 @@ void init_signals(void)
 {
        struct sigaction custom_sigaction;
        struct sigaction profiling_sigaction;
+       struct sigaction ign_sigaction;
        custom_sigaction.sa_sigaction = signal_handler;
        custom_sigaction.sa_flags = SA_SIGINFO;
        profiling_sigaction.sa_sigaction = profiling_step;
        profiling_sigaction.sa_flags = SA_SIGINFO;
+       ign_sigaction.sa_handler = SIG_IGN;
        sigaction(SIGABRT,&custom_sigaction,NULL);
        sigaction(SIGFPE,&custom_sigaction,NULL);
        sigaction(SIGBUS,&custom_sigaction,NULL);
        sigaction(SIGSEGV,&custom_sigaction,NULL);
-       sigaction(SIGPIPE,&custom_sigaction,NULL);
+       sigaction(SIGPIPE,&ign_sigaction,NULL);
        sigaction(SIGPROF,&profiling_sigaction,NULL);
 }
 
@@ -42,6 +44,7 @@ void clear_environment(void)
        int i;
        for(i = 0; i < USER_ENV; i++)
                userenv[i] = 0;
+       profile_depth = 0;
 }
 
 #define EXECUTE(w) ((XT)(w->xt))()
@@ -136,6 +139,8 @@ void primitive_profiling(void)
        {
                timerclear(&prof_timer.it_interval);
                timerclear(&prof_timer.it_value);
+
+               profile_depth = 0;
        }
        else
        {
index ec0d7ad9058055dd9744528c1154058f1eeba2e5..8b7a47c8fe033bcea162d0c158beeb4319b361a9 100644 (file)
@@ -71,9 +71,10 @@ bool perform_write_io_task(PORT* port)
 {
        if(write_step(port))
        {
-               if(port->buf_pos == port->buf_fill)
+               if(port->buf_pos == port->buf_fill || port->io_error != F)
                {
-                       /* All written */
+                       /* All written, or I/O error is preventing further
+                       transaction */
                        port->buf_pos = 0;
                        port->buf_fill = 0;
                        return true;