From ce9a780dc9d03e3789ac5a5da553c7adbb532f34 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 1 Feb 1997 20:08:45 +0000 Subject: [PATCH] Work around for the non-existence of `h_errno' in cygwin32. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1203 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftp/ftp.c | 4 ++++ appl/telnet/telnet/commands.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/appl/ftp/ftp/ftp.c b/appl/ftp/ftp/ftp.c index 2fcb5ea2d..2a683b7db 100644 --- a/appl/ftp/ftp/ftp.c +++ b/appl/ftp/ftp/ftp.c @@ -64,7 +64,11 @@ hookup(char *host, int port) } else { hp = gethostbyname(host); if (hp == NULL) { +#ifdef __CYGWIN32__ + warnx("%s: %s", host, "unknown error"); +#else warnx("%s: %s", host, hstrerror(h_errno)); +#endif code = -1; return NULL; } diff --git a/appl/telnet/telnet/commands.c b/appl/telnet/telnet/commands.c index daab6184a..5c7d012f8 100644 --- a/appl/telnet/telnet/commands.c +++ b/appl/telnet/telnet/commands.c @@ -2213,7 +2213,11 @@ tn(int argc, char **argv) srp = 0; temp = sourceroute(hostp, &srp, &srlen); if (temp == 0) { +#ifdef __CYGWIN32__ + fprintf (stderr, "%s: %s\n", srp ? srp : "", "unknown error"); +#else fprintf (stderr, "%s: %s\n", srp ? srp : "", hstrerror(h_errno)); +#endif setuid(getuid()); return 0; } else if (temp == -1) { @@ -2247,8 +2251,13 @@ tn(int argc, char **argv) _hostname[sizeof(_hostname)-1] = '\0'; hostname = _hostname; } else { +#ifdef __CYGWIN32__ + fprintf (stderr, "%s: %s\n", hostp ? hostp : "", + "unknown error"); +#else fprintf (stderr, "%s: %s\n", hostp ? hostp : "", hstrerror(h_errno)); +#endif setuid(getuid()); return 0; }