Deleted Added
full compact
procs.c (14982) procs.c (30376)
1/*
2 * Copyright (c) 1995
3 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
1/*
2 * Copyright (c) 1995
3 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
34#ifndef lint
35static const char rcsid[] =
36 "$Id$";
37#endif /* not lint */
34
38
39#include <errno.h>
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>
40#include <stdio.h>
41#include <stdlib.h>
42#include <string.h>
38#include <errno.h>
43#include <unistd.h>
39#include <rpc/rpc.h>
40#include <syslog.h>
41#include <netdb.h> /* for gethostbyname() */
42
43#include "statd.h"
44
45/* sm_stat_1 --------------------------------------------------------------- */
46/*

--- 47 unchanged lines hidden (view full) ---

94 res.state = status_info->ourState;
95
96 /* Find existing host entry, or create one if not found */
97 /* If find_host() fails, it will have logged the error already. */
98 if (!gethostbyname(arg->mon_id.mon_name))
99 {
100 syslog(LOG_ERR, "Invalid hostname to sm_mon: %s", arg->mon_id.mon_name);
101 }
44#include <rpc/rpc.h>
45#include <syslog.h>
46#include <netdb.h> /* for gethostbyname() */
47
48#include "statd.h"
49
50/* sm_stat_1 --------------------------------------------------------------- */
51/*

--- 47 unchanged lines hidden (view full) ---

99 res.state = status_info->ourState;
100
101 /* Find existing host entry, or create one if not found */
102 /* If find_host() fails, it will have logged the error already. */
103 if (!gethostbyname(arg->mon_id.mon_name))
104 {
105 syslog(LOG_ERR, "Invalid hostname to sm_mon: %s", arg->mon_id.mon_name);
106 }
102 else if (hp = find_host(arg->mon_id.mon_name, TRUE))
107 else if ((hp = find_host(arg->mon_id.mon_name, TRUE)))
103 {
104 lp = (MonList *)malloc(sizeof(MonList));
105 if (!lp)
106 {
107 syslog(LOG_ERR, "Out of memory");
108 }
109 else
110 {

--- 69 unchanged lines hidden (view full) ---

180 if (debug)
181 {
182 syslog(LOG_DEBUG, "un-monitor request for host %s", arg->mon_name);
183 syslog(LOG_DEBUG, "recall host: %s prog: %d ver: %d proc: %d",
184 arg->mon_name, arg->my_id.my_name, arg->my_id.my_prog,
185 arg->my_id.my_vers, arg->my_id.my_proc);
186 }
187
108 {
109 lp = (MonList *)malloc(sizeof(MonList));
110 if (!lp)
111 {
112 syslog(LOG_ERR, "Out of memory");
113 }
114 else
115 {

--- 69 unchanged lines hidden (view full) ---

185 if (debug)
186 {
187 syslog(LOG_DEBUG, "un-monitor request for host %s", arg->mon_name);
188 syslog(LOG_DEBUG, "recall host: %s prog: %d ver: %d proc: %d",
189 arg->mon_name, arg->my_id.my_name, arg->my_id.my_prog,
190 arg->my_id.my_vers, arg->my_id.my_proc);
191 }
192
188 if (hp = find_host(arg->mon_name, FALSE))
193 if ((hp = find_host(arg->mon_name, FALSE)))
189 {
190 if (do_unmon(hp, &arg->my_id)) sync_file();
191 else
192 {
193 syslog(LOG_ERR, "unmon request from %s, no matching monitor",
194 arg->my_id.my_name);
195 }
196 }

--- 12 unchanged lines hidden (view full) ---

209 Notes: Releases all monitor requests (if any) from the specified
210 host and program number.
211*/
212
213struct sm_stat *sm_unmon_all_1_svc(my_id *arg, struct svc_req *req)
214{
215 static sm_stat res;
216 HostInfo *hp;
194 {
195 if (do_unmon(hp, &arg->my_id)) sync_file();
196 else
197 {
198 syslog(LOG_ERR, "unmon request from %s, no matching monitor",
199 arg->my_id.my_name);
200 }
201 }

--- 12 unchanged lines hidden (view full) ---

214 Notes: Releases all monitor requests (if any) from the specified
215 host and program number.
216*/
217
218struct sm_stat *sm_unmon_all_1_svc(my_id *arg, struct svc_req *req)
219{
220 static sm_stat res;
221 HostInfo *hp;
217 MonList *lp;
218 int i;
219
220 if (debug)
221 {
222 syslog(LOG_DEBUG, "unmon_all for host: %s prog: %d ver: %d proc: %d",
223 arg->my_name, arg->my_prog, arg->my_vers, arg->my_proc);
224 }
225

--- 118 unchanged lines hidden (view full) ---

344 }
345 clnt_destroy(cli);
346 }
347 lp = lp->next;
348 }
349
350 exit (0); /* Child quits */
351}
222 int i;
223
224 if (debug)
225 {
226 syslog(LOG_DEBUG, "unmon_all for host: %s prog: %d ver: %d proc: %d",
227 arg->my_name, arg->my_prog, arg->my_vers, arg->my_proc);
228 }
229

--- 118 unchanged lines hidden (view full) ---

348 }
349 clnt_destroy(cli);
350 }
351 lp = lp->next;
352 }
353
354 exit (0); /* Child quits */
355}
352