Re: [gamin] Gamin client ignores Ctrl-C while in FAMNextEvent?



On Fri, Oct 15, 2004 at 12:55:11AM -0700, Aleksey Nogin wrote:
> On 14.10.2004 23:39, Daniel Veillard wrote:
> 
> >  FAMNextEvent() blocks for the next event. Should it exit with an
> >error because read() got blocked due to an Ctrl-C event ?
> 
> I am not sure whether this is the best way to go, but this seems to be 
> what FAM is doing (which, of course, does not imply it should be done 
> this way).
> 
> It seems that going this route would be a trivial change to gamin:
> 
> --- libgamin/gam_api.c.orig     2004-10-03 08:11:46.000000000 -0700
> +++ libgamin/gam_api.c  2004-10-15 00:14:18.485164508 -0700
> @@ -711,11 +711,8 @@
>      if (ret < 0) {
>          return (-1);
>      }
> -retry:
>      ret = read(fd, (char *) data, size);
>      if (ret < 0) {
> -        if (errno == EINTR)
> -            goto retry;
>          gam_error(DEBUG_INFO, "failed to read() from server 
> connection\n");
>          return (-1);
>      }

  That's only one part of the change needed, you also need to propagate
taht it's interrupted to not disconnect/reconnect.

> OTOH I just found a way to make Ctrl-C work correctly in OMake even with 
> the current version of gamin (OCaml C interface has functions 
> caml_enter_blocking_section/caml_leave_blocking_section and if I wrap 
> calls to FAM functions using those, then everything works properly), so 
> please feel free to WONTFIX this.

  Okay, this need fixing but is not urgent.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]