Deleted Added
full compact
sprayd.c (90336) sprayd.c (95658)
1/*
2 * Copyright (c) 1994 Christos Zoulas
3 * 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

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

25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef lint
32static const char rcsid[] =
1/*
2 * Copyright (c) 1994 Christos Zoulas
3 * 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

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

25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef lint
32static const char rcsid[] =
33 "$FreeBSD: head/libexec/rpc.sprayd/sprayd.c 90336 2002-02-07 05:24:53Z imp $";
33 "$FreeBSD: head/libexec/rpc.sprayd/sprayd.c 95658 2002-04-28 15:18:50Z des $";
34#endif /* not lint */
35
36#include <rpc/rpc.h>
37#include <rpc/pmap_clnt.h>
38#include <rpcsvc/spray.h>
39#include <signal.h>
40#include <stdio.h>
41#include <stdlib.h>

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

133
134 switch (rqstp->rq_proc) {
135 case SPRAYPROC_CLEAR:
136 scum.counter = 0;
137 (void) gettimeofday(&clear, 0);
138 /*FALLTHROUGH*/
139
140 case NULLPROC:
34#endif /* not lint */
35
36#include <rpc/rpc.h>
37#include <rpc/pmap_clnt.h>
38#include <rpcsvc/spray.h>
39#include <signal.h>
40#include <stdio.h>
41#include <stdlib.h>

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

133
134 switch (rqstp->rq_proc) {
135 case SPRAYPROC_CLEAR:
136 scum.counter = 0;
137 (void) gettimeofday(&clear, 0);
138 /*FALLTHROUGH*/
139
140 case NULLPROC:
141 (void)svc_sendreply(transp, xdr_void, (char *)NULL);
141 (void)svc_sendreply(transp, (xdrproc_t)xdr_void, NULL);
142 return;
143
144 case SPRAYPROC_SPRAY:
145 scum.counter++;
146 return;
147
148 case SPRAYPROC_GET:
149 (void) gettimeofday(&get, 0);
150 timersub(&get, &clear, &get);
151 scum.clock.sec = get.tv_sec;
152 scum.clock.usec = get.tv_usec;
153 break;
154
155 default:
156 svcerr_noproc(transp);
157 return;
158 }
159
142 return;
143
144 case SPRAYPROC_SPRAY:
145 scum.counter++;
146 return;
147
148 case SPRAYPROC_GET:
149 (void) gettimeofday(&get, 0);
150 timersub(&get, &clear, &get);
151 scum.clock.sec = get.tv_sec;
152 scum.clock.usec = get.tv_usec;
153 break;
154
155 default:
156 svcerr_noproc(transp);
157 return;
158 }
159
160 if (!svc_sendreply(transp, xdr_spraycumul, (caddr_t)&scum)) {
160 if (!svc_sendreply(transp, (xdrproc_t)xdr_spraycumul, &scum)) {
161 svcerr_systemerr(transp);
162 syslog(LOG_ERR, "bad svc_sendreply");
163 }
164}
161 svcerr_systemerr(transp);
162 syslog(LOG_ERR, "bad svc_sendreply");
163 }
164}