X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fdwatcher.ml;h=3453d54f78e16238dc93bb8d2addbcb074c2c80c;hb=35a64cada2c6a40baa730404d298a5032a28c201;hp=7761d30ccf8a9a0dbcd26aca84fc1ff531c800eb;hpb=892d26d4e05de55ae94d21a586e6a0bfa724e327;p=vsys.git diff --git a/fdwatcher.ml b/fdwatcher.ml index 7761d30..3453d54 100644 --- a/fdwatcher.ml +++ b/fdwatcher.ml @@ -1,3 +1,6 @@ +(** Fdwatcher - The main event loop. Agnostic to the type of file descriptors + involved.*) + open Printf open Globals @@ -8,7 +11,6 @@ let cbtable = Hashtbl.create 1024 * fifo outputs, the out descriptor must be opened a nouveau whenever we * want to send out data, and so we keep the associated filename as well. * Same with input fifos. Yipee.*) - let add_fd (evpair:fname_and_fd) (fd_other:fname_and_fd) (callback:fname_and_fd->fname_and_fd->unit) = let (fname,fd) = evpair in fdset := (fd::!fdset); @@ -16,7 +18,7 @@ let add_fd (evpair:fname_and_fd) (fd_other:fname_and_fd) (callback:fname_and_fd- let del_fd fd = fdset:=List.filter (fun l->l<>fd) !fdset; - flush Pervasives.stdout + flush logfd let start_watch () = while (true) @@ -29,4 +31,3 @@ let start_watch () = let (func,(evd,fd_other)) = Hashtbl.find cbtable elt in func evd fd_other) fds done -