And i still have laying around a patch to avoid writing
to DEAD twice if *record* is also set.
If *record* is set, avoid writing dead content twice..
If a message cannot be sent it is written to *DEAD*. However,
if *record* is also set it is written to *DEAD* twice.
It happens to be fixable on Mac OS X Snow Leopard, NetBSD 6,
OpenBSD 5.1 if a lseek(2) call in sendout.c:savemail() is removed.
This lseek(2) call bypasses the Std I/O mechanism. Well, a very
fflush(3)/fseek(3) combination is defined for POSIX-conforming
systems, and as an extension of the C standard (this is from IEEE
Std 1003.1, 1996 Edition):
22.214.171.124 fseek(), rewind()
If the most recent operation, other than ftell(), on a given
stream is fflush(), the file offset in the underlying open
file description shall be adjusted to reflect the location
specified by the fseek().
Even then it is questionable wether an application should assume
internals about stdio and, even more, kernel states. On the
other hand it is completely mysterious to me why the mentioned
stdio libs do not catch that, and on the other hand. But
i don't know enough of how nail(1) functions and so maybe it's
The Heirloom repo doesn't offer any annotate info on these
lines, they are present from the beginning.
This is not politics but a bug.
sendout.c | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/sendout.c b/sendout.c
index 2f916d8..ef277ac 100644
@@ -698,13 +698,6 @@ savemail(char *name, FILE *fi)
error = -1;
- * OpenBSD 3.2 and NetBSD 1.5.2 were reported not to
- * reset the kernel file offset after the calls above,
- * a clear violation of IEEE Std 1003.1, 1996, 126.96.36.199.
- * So do it 'manually'.
- lseek(fileno(fi), 0, SEEK_SET);