~ubuntu-branches/ubuntu/oneiric/nfs-utils/oneiric

« back to all changes in this revision

Viewing changes to utils/statd/stat.c

  • Committer: Steve Langasek
  • Date: 2010-06-04 09:53:57 UTC
  • mfrom: (14.1.5 sid)
  • Revision ID: vorlon@debian.org-20100604095357-zbu3na972v3nmgvg
mergeĀ versionĀ 1:1.2.2-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#include <netdb.h>
13
13
#include "statd.h"
14
14
 
15
 
/* 
 
15
/*
16
16
 * Services SM_STAT requests.
17
17
 *
18
18
 * According the the X/Open spec's on this procedure: "Implementations
37
37
 *      other way to get it.
38
38
 *   3/ That's what we always did in the past.
39
39
 */
40
 
struct sm_stat_res * 
41
 
sm_stat_1_svc (struct sm_name *argp, struct svc_req *rqstp)
 
40
struct sm_stat_res *
 
41
sm_stat_1_svc(struct sm_name *argp,
 
42
                __attribute__ ((unused)) struct svc_req *rqstp)
42
43
{
43
44
  static sm_stat_res result;
44
 
 
45
 
  if (gethostbyname (argp->mon_name) == NULL) {
46
 
    note (N_WARNING, "gethostbyname error for %s", argp->mon_name);
 
45
  char *name;
 
46
 
 
47
  xlog(D_CALL, "Received SM_STAT from %s", argp->mon_name);
 
48
 
 
49
  name = statd_canonical_name(argp->mon_name);
 
50
  if (name == NULL) {
47
51
    result.res_stat = STAT_FAIL;
48
 
    dprintf (N_DEBUG, "STAT_FAIL for %s", argp->mon_name);
 
52
    xlog (D_GENERAL, "STAT_FAIL for %s", argp->mon_name);
49
53
  } else {
50
54
    result.res_stat = STAT_SUCC;
51
 
    dprintf (N_DEBUG, "STAT_SUCC for %s", argp->mon_name);
 
55
    xlog (D_GENERAL, "STAT_SUCC for %s", argp->mon_name);
 
56
    free(name);
52
57
  }
53
58
  result.state = MY_STATE;
54
59
  return(&result);