Alan Clifford wrote:
On Fri, 16 Jun 2006, Don Russell wrote:
DR>
DR> Maybe I can suggest a change to host/dig people to include a return
DR> code.... but I suspect that won't be well received...
DR>
DR>
DR> Cheers,
DR> Don
DR>
A wrapper around gethostbyname might do. Here is one I've cobbled
together:
That's a good idea... I modified the code a little to return h_errno if
there is an error. and also write the text equivalent to stderr.
i.e.
switch (h_errno) {
case TRY_AGAIN: fprintf(stderr, "%s"\n", "TRY AGAIN"; break;
...
default: frpintf(stderr, "RC=%d\n", h_errno); break;
}
So, even if gethostbyname returns new error codes in the future, this
little thing will just pass on those same error codes. The text to
stderr isn't much real use, other then when I was trying to see which
errors codes were produced for different cases.
Don
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail