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
This commit is contained in:
Assar Westerlund
1997-02-01 20:08:45 +00:00
parent 13f126aa06
commit ce9a780dc9
2 changed files with 13 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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;
}