SCO XENIX bug prevents smail from working correctly.
Keith Gabryelski
ag at elgar.UUCP
Thu Jan 19 10:15:34 AEST 1989
The SCO XENIX C compiler (mine is version 2.2) does not handle a
return from main() correctly. A return from main should be the same
as an exit from main. It isn't.
You can confirm this by compiling, running, and checking the exit
status of:
main(){ return 0; }
and
main(){ exit(0); }
(On my machine, a 386 box running 2.3.1 OS and 2.2 dev system
The former's exit status is 1. The latter's exit status is 0.
Smail uses a return from main().
Smail will always exit (if mail was delivered ok) with a status of `2'
even though the exitstat is 0.
HDB (SCO 2.3.1) barfs (returns exit status info to calling site) on
any status other then `0' from rmail (rmail is linked to smail).
[Sorry Brian, I should have found this earlier.]
`recmail' (news) expects any non-zero return value of MAILER
(/usr/bin/smail) to be an indication of an error and returns mail
while passing the error along to `rn'. This shows itself to the user
as `rn' barfing after any `R' or `r' command (and returning mail to
you, the sender) even though mail has been sent. (Mailing to a
moderator would also barf, although I haven't tried it).
The following patch to smail[main.c] will fix this:
212c212
< return( exitstat );
---
> exit( exitstat );
This gist is, smail must use exit() instead of return to leave main
with a status code.
Pax, Keith
--
ag at elgar.CTS.COM Keith Gabryelski ...!{ucsd, crash}!elgar!ag
More information about the Comp.unix.xenix
mailing list