Article View: comp.mail.sendmail
Article #2907sendmail reports "Bad file number"
From: Eric Wassenaar
Date: Sat, 19 Nov 1988 22:26
Date: Sat, 19 Nov 1988 22:26
17 lines
1244 bytes
1244 bytes
Every now and then there is some discussion about the "Bad file number" status that sendmail reports in case an smtp transaction fails. So far I have not read a satisfactory answer. I think this is: In the routine smtpquit() in usersmtp.c there is a double fclose(SmtpIn) and fclose(SmtpOut) which both refer to the same fileno (the socket). The first one actually closes the socket, so the second one fails and clobbers errno. The remedy is to save the current errno before the double fclose() and restore it afterwards. Eric Wassenaar -- Organization: NIKHEF-H, National Institute for Nuclear and High-Energy Physics Address: Kruislaan 409, P.O. Box 41882, 1009 DB Amsterdam, the Netherlands Phone: +31 20 5920412 Home phone: +31 20 909449 Telex: 10262 (hef nl) Internet: e07@nikhefh.hep.nl Bitnet: nikhefh!e07@mcvax.bitnet
Technical Details
Message-ID:
<578@nikhefh.hep.nl>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!pacbell!ames!ncar!boulder!sunybcs!bingvaxu!leah!itsgw!steinmetz!uunet!mcvax!nikhefh!e07Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!pacbell!ames!ncar!boulder!sunybcs!bingvaxu!leah!itsgw!steinmetz!uunet!mcvax!nikhefh!e07 From: e07@nikhefh.hep.nl (Eric Wassenaar) Newsgroups: comp.mail.sendmail,comp.bugs.4bsd Subject: sendmail reports "Bad file number" Message-ID: <578@nikhefh.hep.nl> Date: 19 Nov 88 22:26:47 GMT Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 17