Path: utzoo!attcan!uunet!izimbra!dsc From: dsc@izimbra.CSS.GOV (card carrying aclu member) Newsgroups: comp.mail.sendmail Subject: Re: sendmail generates bogus error messages Summary: fprintf clobbers errno in smtpinit() Keywords: errno fprintf error ENOTTY network host Message-ID: <30999@uunet.UU.NET> Date: 3 Oct 88 19:18:06 GMT References: <3153@hermes.ai.mit.edu> Sender: news@uunet.UU.NET Organization: the levi stubbs appreciation society Lines: 25 In article <3153@hermes.ai.mit.edu> wisner@zug.AI.MIT.EDU (Bill Wisner) writes: >When sending mail to a host that isn't currently reachable, I should >be seeing error messages like > Deferred: Connection timed out during user open with basel.ai.mit.edu >Instead, I get this: > Deferred: Not a typewriter >I think that somewhere between the time the connection actually times >out and the time the error message is generated, something happens to >change errno to ENOTTY. But what? Anyone know how to fix this? i believe the problem you are seeing is that errno gets clobbered during a fprintf() call in usersmtp.c. look in smtpinit() for the fprintf() call where one of the arguments is errstring(errno) and add two assignments to save & restore errno before calling fprintf, ala r = errno; fprintf(CurEnv->e_xfp, "421 %s.%s... Deferred: %s\n", pvp[1], m->m_name, errstring(errno)); errno = r; of course, why errno is getting set to ENOTTY or some other value by fprintf is in itself an interesting question ... dsc