On Sun, Sep 28, 2025 at 09:24:58PM +0200, Samuel Thibault wrote:
> [email protected], le dim. 28 sept. 2025 19:17:16 +0100, a ecrit:
> > -      write (fd, s, t - s);
> > +      err = write (fd, s, t - s);
> > +      assert_backtrace (err != -1);
> 
> You actually want to check that the return value is the number of bytes
> that you have passed, otherwise we had a short-write. That'd be
> surprising for a tty (normally it would just block), but better be safe
> than risk losing characters.
> 

Is 'assert_backtrace (err != (t - s))' enough? Or should I implement a
'full_write' which loops until all byte are written?


Reply via email to