+let openentry_int fifoin =
+ let fdin =
+ try openfile fifoin [O_RDONLY;O_NONBLOCK] 0o777 with
+ e->fprintf logfd "Error opening and connecting FIFO: %s,%o\n" fifoin 0o777;flush logfd;raise e
+ in
+ fdin
+
+
+(** Open fifos for a session. SHOULD NOt shutdown vsys if the fifos don't exist *)
+let openentry_in root_dir fqp_in backend_spec =
+ Dirwatcher.mask_watch root_dir;
+ let fd_in = openentry_int fqp_in in
+ Dirwatcher.unmask_watch root_dir [S_Open];
+ let (fqp,slice_name) = backend_spec in
+ Hashtbl.replace direct_fifo_table fqp_in (Some(root_dir,fqp,slice_name,fd_in))
+
+let openentry root_dir fqp backend_spec =
+ let fqp_in = String.concat "." [fqp;"in"] in
+ openentry_in root_dir fqp_in backend_spec
+
+let reopenentry fifoin =
+ let entry = try Hashtbl.find direct_fifo_table fifoin with _ -> None in
+ match entry with
+ | Some(dir, fqp,slice_name,fd) -> close_if_open fd;openentry_in dir fifoin (fqp,slice_name)
+ | None -> ()
+