done
| _ -> fprintf logfd "Bug! Process fd received in the channel handler\n";flush logfd;raise Bug
-
let rec openentry_int fifoin fifoout (abspath:string*string) =
let fdin =
try openfile fifoin [O_RDONLY;O_NONBLOCK] 0o777 with
let (script_infd,pout) = Unix.pipe () in
let (pin,script_outfd) = Unix.pipe () in
set_nonblock script_infd;
+ ignore(sigprocmask SIG_BLOCK [Sys.sigchld]);
let rpid = try Some(create_process execpath [|execpath;slice_name|] pin pout pout) with e -> fprintf logfd "Error executing service: %s\n" execpath;flush logfd;None
in
match rpid with
cont:=false
|Sys_blocked_io ->fprintf logfd "Sysblockedio\n";flush logfd;
cont:=false
- | _ ->fprintf logfd "Bug: unhandled exception\n";flush logfd;raise Bug
- done
+ | Unix_error(_,s1,s2) -> fprintf logfd "Unix error %s - %s\n" s1 s2;flush logfd;cont:=false
+ (*| _ ->fprintf logfd "Bug: unhandled exception\n";flush
+ * logfd;raise Bug*)
+ done;
+ ignore(sigprocmask SIG_UNBLOCK [Sys.sigchld])
| BrokenPipe -> ()
| Fifo(_) -> fprintf logfd "BUG! received process event from fifo\n";raise Bug