[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix to use the saved errno in scheduler/transport.c
- To: zmailer@nic.funet.fi
- Subject: Fix to use the saved errno in scheduler/transport.c
- From: Alex Kiernan <alex.kiernan@gmail.com>
- Date: Tue, 18 Oct 2005 11:15:31 +0100
- DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=ZT+oS1ur8iZGa89xUi8teFVGK4L3dPQQHUZSrSvXYfSOr+n0UE1xOUG+cqd5cZjdWZ7MPpDv0vGv5u1um5dpkyS/N8xMtWUibNeyPYvCM/G/WrUYRQiW5ohBUi3DKZgqp3Zn1JaiPX/lRmsswDzh/EX4M5xa06bRNJGG3fS2Kp0=
- Original-Recipient: rfc822;zmailer-log@nic.funet.fi
- Sender: zmailer-owner@nic.funet.fi
We've had a long standing problem of the scheduler aborting very
occasionally. I went and stared at the relevant code earlier today and
it looks like it might be the classic errno getting overwritten by a
later syscall problem. What's stranger is the code has all the
machinery to avoid the problem, it just doesn't actually use the saved
value!
I see the problem so infrequently I can't really test it, but I'm
hoping this fixes it.
--
Alex Kiernan
Index: scheduler/transport.c
===================================================================
RCS file: /cvsroot/upstream/zmailer/scheduler/transport.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 transport.c
--- scheduler/transport.c 6 Jul 2004 16:28:04 -0000 1.1.1.3
+++ scheduler/transport.c 18 Oct 2005 09:01:16 -0000
@@ -1174,9 +1174,9 @@
/* sfprintf(sfstderr, "got an interrupt (%d)\n", errno); */
in_select = 0;
- if (errno == EINTR || errno == EAGAIN)
+ if (err == EINTR || err == EAGAIN)
return 0;
- if (errno == EINVAL || errno == EBADF) {
+ if (err == EINVAL || err == EBADF) {
sfprintf(sfstderr, "** select() returned errno=%d\n", err);
for (i = 0; i < maxf; ++i) {
if (_Z_FD_ISSET(i,rdmask) && fcntl(i,F_GETFL,0) < 0)