emacs-devel
[Top][All Lists]
Advanced

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

Re: oops? read/write vs type of length parameter


From: Eli Zaretskii
Subject: Re: oops? read/write vs type of length parameter
Date: Fri, 15 Apr 2011 12:41:02 +0300

> Date: Fri, 15 Apr 2011 01:55:52 -0700
> From: Paul Eggert <address@hidden>
> Cc: Eli Zaretskii <address@hidden>, address@hidden, address@hidden
> 
> Anyway, I changed all the size_ts to EMACS_INTs and committed the patch
> (which fixed other bugs as already mentioned) as bzr 103919.

The change you made in emacs_read makes it possible for it to read
less than it was requested to:

  -  while ((rtnval = read (fildes, buf, nbyte)) == -1
  +  while ((rtnval = read (fildes, buf, min (nbyte, MAX_RW_COUNT))) == -1
           && (errno == EINTR))
       QUIT;
     return (rtnval);
   }

I don't think it's a good idea to silently truncate the request and
rely on the callers to loop (although I think they all do for now).
So I think we need a loop in emacs_read like what we do in
emacs_write.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]