Re: [exim] exim dies on the interrupted system call

Top Page

Reply to this message
Author: David Woodhouse
To: exim-users
CC: Каялайнен
Subject: Re: [exim] exim dies on the interrupted system call
On Mon, 2010-12-27 at 21:39 -0500, Phil Pennock wrote:
> This is a bug in Exim. Looking at the code, I'm rather shocked that
> it has never bitten us before now.

It doesn't bite because most operating systems don't actually return
short writes on a real file except on EOF. Even though POSIX permits
them to.

(The case you've seen is actually returning -1 / EINTR rather than a
short write where it writes fewer bytes than you asked, but that's just
a special case of the same thing.)

In Linux we avoid doing short writes because we *know* a lot of
userspace will break if we do that. Exim will not be the only program
which breaks on the FreeBSD system in question.

But yes, strictly speaking it *is* a bug in Exim. There are a bunch of
write() calls which we should wrap with our own function that loops
until it's either written all it had to write, or got a *real* error.