let del_fd fd =
  fdset:=List.filter (fun l->l<>fd) !fdset;
  flush logfd