Bugfix. Crashing vsys scripts now get reported instead of failing silently
[vsys.git] / fifowatcher.ml
index 803ee5e..4dbd70a 100644 (file)
@@ -38,7 +38,7 @@ let receive_process_event (idesc:fd_and_fname) (_:fd_and_fname) =
                   printf "Here: %d %s\n" !count curline;flush Pervasives.stdout;
                   fprintf fifo_outchan "%s\n" curline;flush fifo_outchan
               with 
-                | End_of_file|Sys_blocked_io|Unix_error(EPIPE,_,_) ->
+                | End_of_file|Sys_blocked_io|Unix_error(EPIPE,_,_)|Unix_error(EBADF,_,_) ->
                     begin
                       cont:=false
                     end
@@ -70,7 +70,7 @@ and receive_fifo_event eventdescriptor outdescriptor =
       | Some(str)->
           (
             try openfile str [O_WRONLY;O_NONBLOCK] 0o777 with
-                _->printf "Problemo:%s\n" str;flush Pervasives.stdout;stdout
+                _->printf "Output pipe not open, using stdout in place of %s\n" str;flush Pervasives.stdout;stdout
           )
       | None-> printf "Bug, nameless pipe\n";raise Bug
   in