| [] -> false
| car::cdr -> if (car==elt) then true else list_check cdr elt
-let openentry_safet fifoin =
+let openentry_int fifoin =
let fdin =
try openfile fifoin [O_RDONLY;O_NONBLOCK] 0o777 with
e->logprint "Error opening and connecting FIFO: %s,%o\n" fifoin 0o777;raise e
(** Open entry safely, by first masking out the file to be opened *)
let openentry_safe root_dir fqp_in backend_spec =
Dirwatcher.mask_watch fqp_in;
- let fd_in = openentry_safet fqp_in in
- Dirwatcher.unmask_watch fqp_in;
+ let fd_in = openentry_int fqp_in in
let (fqp,slice_name) = backend_spec in
Hashtbl.replace direct_fifo_table fqp_in (Some(root_dir,fqp,slice_name,fd_in))
let is_event = list_check evlist in
if (is_event Open) then
let fqp_in = String.concat "/" [dirname;fname] in
- begin
- connect_file fqp_in;
- add_dir_watch dirname
- end
+ connect_file fqp_in
let del_dir_watch fqp =
()
let mask_watch fqp =
try
- print "Masking %s %d\n" fqp (String.length fqp);
Hashtbl.replace masks fqp true
with _ ->
()
let fqp = String.concat "/" [dirname;purestr] in
let mask_filter = Hashtbl.mem masks fqp in
begin
- (*print "Received event for - %s\n"
- * fqp;*)
- if ((not mask_filter) && false) then
- handler wd dirname evlist purestr
+ if ((not mask_filter)) then
+ begin
+ (*logprint "Received event for - %s\n"
+ fqp;*)
+ handler wd dirname evlist
+ purestr
+ end
else
- print "%s is masked\n" fqp
+ unmask_watch fqp
end
end
| _ -> ())
exit(-1);
}
- printf("Opening...\n");
if ((fd_in = open(top_in_file, O_WRONLY)) < 0) {
fprintf(stderr, "error opening %s\n", top_in_file);
exit(-1);
}
- printf("Open.\n");
-
if ((flag = fcntl(fd_out, F_GETFL)) == -1) {
printf("fcntl get failed\n");
exit(-1);
FD_ZERO(&readSet);
FD_SET(fd_out, &readSet);
- printf("Selecting...\n");
res = select(fd_out + 1, &readSet, NULL, NULL, NULL);
- printf("Selected...\n");
if (res < 0) {
if (errno == EINTR || errno == EAGAIN) {
printf(".");