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

Revision 14351, 1.2 KB checked in by ghudson, 25 years ago (diff)
Don't declare h_error; that's netdb.h's job.
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.2 2000-02-28 21:47:41 ghudson Exp $";
17
18#include "globalmessage.h"
19#include "gethost_err.h"
20#include <netdb.h>
21
22Code_t gethost_error(void)
23{
24  init_ghs_err_tbl();
25
26  switch(h_errno) {
27  case HOST_NOT_FOUND:
28    return(GETHOST_HOST_NOT_FOUND);
29  case TRY_AGAIN:
30    return(GETHOST_TRY_AGAIN);
31  case NO_RECOVERY:
32    return(GETHOST_NO_RECOVERY);
33  case NO_ADDRESS:
34    return(GETHOST_NO_ADDRESS);
35  default:
36    return(GETHOST_INVALID);
37  }
38}
39   
Note: See TracBrowser for help on using the repository browser.