Tugger the SLUGger!SLUG Mailing List Archives

Re: [chat] you are in a maze of twisty little header files, all alike...


On Wed Jul 02, 2003 at 15:35:04 +1000, Jan Schmidt wrote:
><quote who="Benno">
>
>> On Wed Jul 02, 2003 at 15:09:31 +1000, Jan Schmidt wrote:
>> ><quote who="Jamie Wilkinson">
>> >
>> >> So I got a useful error message from curl just now:
>> >> 
>> >> curl: (7) socket error: 113
>> >
>> >*snip*
>> >
>> >> 113 means "host unreachable".  I think I might patch curl to add strerror
>> >> calls in the right places :-)
>> >> 
>> >
>> >As a time saver:
>> >
>> >jan@oven:/usr/include$ grep -r 113 . | grep errno
>> >./asm/errno.h:#define   EHOSTUNREACH    113     /* No route to host */
>> >
>> >strerror sounds like a good patch to me.
>> Or:
>> 
>> $ cat > perror.c
>
>Wheeeee!
>
>#!/usr/bin/perl
>use POSIX;
>print POSIX::strerror($ARGV[0]), "\n";
>

FWIW:

#!/usr/bin/python
import os, sys
print os.strerror(int(sys.argv[1]))

Benno-waiting-to-see-it-in-sed