source: trunk/athena/bin/get_message/gethost_errors.c @ 14063

Revision 14063, 1.2 KB checked in by danw, 25 years ago (diff)
get_message, formerly in athena/bin/gms
Line 
1/* Copyright 1988, 1998 by the Massachusetts Institute of Technology.
2 *
3 * Permission to use, copy, modify, and distribute this
4 * software and its documentation for any purpose and without
5 * fee is hereby granted, provided that the above copyright
6 * notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting
8 * documentation, and that the name of M.I.T. not be used in
9 * advertising or publicity pertaining to distribution of the
10 * software without specific, written prior permission.
11 * M.I.T. makes no representations about the suitability of
12 * this software for any purpose.  It is provided "as is"
13 * without express or implied warranty.
14 */
15
16static const char rcsid[] = "$Id: gethost_errors.c,v 1.1 1999-12-08 22:06:45 danw Exp $";
17
18#include "globalmessage.h"
19#include "gethost_err.h"
20#include <netdb.h>
21
22extern int h_errno;
23
24Code_t gethost_error(void)
25{
26  init_ghs_err_tbl();
27
28  switch(h_errno) {
29  case HOST_NOT_FOUND:
30    return(GETHOST_HOST_NOT_FOUND);
31  case TRY_AGAIN:
32    return(GETHOST_TRY_AGAIN);
33  case NO_RECOVERY:
34    return(GETHOST_NO_RECOVERY);
35  case NO_ADDRESS:
36    return(GETHOST_NO_ADDRESS);
37  default:
38    return(GETHOST_INVALID);
39  }
40}
41   
Note: See TracBrowser for help on using the repository browser.