X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fstatd%2Fstat.c;h=799239f1d956f668c0cf2c79c98175914740b0b4;hb=69620a042d1151871a31f07ccd210b2dab49c628;hp=021e78685846c31120f9402897fb894c083f3807;hpb=8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9;p=nfs-utils.git diff --git a/utils/statd/stat.c b/utils/statd/stat.c index 021e786..799239f 100644 --- a/utils/statd/stat.c +++ b/utils/statd/stat.c @@ -5,7 +5,10 @@ * NSM for Linux. */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include "statd.h" @@ -18,6 +21,21 @@ * status." My implementation is operative; it returns 'STAT_SUCC' * whenever it can resolve the hostname that it's being asked to * monitor, and returns 'STAT_FAIL' otherwise. + * + * sm_inter.x says the 'state' returned should be + * "state number of site sm_name". It is not clear how to get this. + * X/Open says: + * STAT_SUCC + * The NSM will monitor the given host. "sm_stat_res.state" contains + * the state of the NSM. + * Which implies that 'state' is the state number of the *local* NSM. + * href=http://www.opengroup.org/onlinepubs/9629799/SM_STAT.htm + * + * We return the *local* state as + * 1/ We have easy access to it. + * 2/ It might be useful to a remote client who needs it and has no + * other way to get it. + * 3/ That's what we always did in the past. */ struct sm_stat_res * sm_stat_1_svc (struct sm_name *argp, struct svc_req *rqstp) @@ -25,12 +43,12 @@ sm_stat_1_svc (struct sm_name *argp, struct svc_req *rqstp) static sm_stat_res result; if (gethostbyname (argp->mon_name) == NULL) { - log (L_WARNING, "gethostbyname error for %s", argp->mon_name); + note (N_WARNING, "gethostbyname error for %s", argp->mon_name); result.res_stat = STAT_FAIL; - dprintf (L_DEBUG, "STAT_FAIL for %s", argp->mon_name); + dprintf (N_DEBUG, "STAT_FAIL for %s", argp->mon_name); } else { result.res_stat = STAT_SUCC; - dprintf (L_DEBUG, "STAT_SUCC for %s", argp->mon_name); + dprintf (N_DEBUG, "STAT_SUCC for %s", argp->mon_name); } result.state = MY_STATE; return(&result);