Deleted Added
full compact
warmstart.c (74462) warmstart.c (104589)
1/*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
8 *

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

30 * warmstart.c
31 * Allows for gathering of registrations from a earlier dumped file.
32 *
33 * Copyright (c) 1990 by Sun Microsystems, Inc.
34 */
35
36/*
37 * #ident "@(#)warmstart.c 1.7 93/07/05 SMI"
1/*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
8 *

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

30 * warmstart.c
31 * Allows for gathering of registrations from a earlier dumped file.
32 *
33 * Copyright (c) 1990 by Sun Microsystems, Inc.
34 */
35
36/*
37 * #ident "@(#)warmstart.c 1.7 93/07/05 SMI"
38 * $FreeBSD: head/usr.sbin/rpcbind/warmstart.c 74462 2001-03-19 12:50:13Z alfred $/
38 * $FreeBSD: head/usr.sbin/rpcbind/warmstart.c 104589 2002-10-07 01:16:00Z alfred $/
39 */
40#include <sys/types.h>
41#include <sys/stat.h>
42#include <stdio.h>
43#include <rpc/rpc.h>
44#include <rpc/rpcb_prot.h>
45#include <rpc/xdr.h>
46#ifdef PORTMAP

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

139
140error: fprintf(stderr, "rpcbind: will start from scratch\n");
141 return (FALSE);
142}
143
144void
145write_warmstart()
146{
39 */
40#include <sys/types.h>
41#include <sys/stat.h>
42#include <stdio.h>
43#include <rpc/rpc.h>
44#include <rpc/rpcb_prot.h>
45#include <rpc/xdr.h>
46#ifdef PORTMAP

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

139
140error: fprintf(stderr, "rpcbind: will start from scratch\n");
141 return (FALSE);
142}
143
144void
145write_warmstart()
146{
147 (void) write_struct(RPCBFILE, xdr_rpcblist_ptr, &list_rbl);
147 (void) write_struct(RPCBFILE, (xdrproc_t)xdr_rpcblist_ptr, &list_rbl);
148#ifdef PORTMAP
148#ifdef PORTMAP
149 (void) write_struct(PMAPFILE, xdr_pmaplist_ptr, &list_pml);
149 (void) write_struct(PMAPFILE, (xdrproc_t)xdr_pmaplist_ptr, &list_pml);
150#endif
151
152}
153
154void
155read_warmstart()
156{
157 rpcblist_ptr tmp_rpcbl = NULL;
158#ifdef PORTMAP
159 struct pmaplist *tmp_pmapl = NULL;
160#endif
161 int ok1, ok2 = TRUE;
162
150#endif
151
152}
153
154void
155read_warmstart()
156{
157 rpcblist_ptr tmp_rpcbl = NULL;
158#ifdef PORTMAP
159 struct pmaplist *tmp_pmapl = NULL;
160#endif
161 int ok1, ok2 = TRUE;
162
163 ok1 = read_struct(RPCBFILE, xdr_rpcblist_ptr, &tmp_rpcbl);
163 ok1 = read_struct(RPCBFILE, (xdrproc_t)xdr_rpcblist_ptr, &tmp_rpcbl);
164 if (ok1 == FALSE)
165 return;
166#ifdef PORTMAP
164 if (ok1 == FALSE)
165 return;
166#ifdef PORTMAP
167 ok2 = read_struct(PMAPFILE, xdr_pmaplist_ptr, &tmp_pmapl);
167 ok2 = read_struct(PMAPFILE, (xdrproc_t)xdr_pmaplist_ptr, &tmp_pmapl);
168#endif
169 if (ok2 == FALSE) {
170 xdr_free((xdrproc_t) xdr_rpcblist_ptr, (char *)&tmp_rpcbl);
171 return;
172 }
173 xdr_free((xdrproc_t) xdr_rpcblist_ptr, (char *)&list_rbl);
174 list_rbl = tmp_rpcbl;
175#ifdef PORTMAP
176 xdr_free((xdrproc_t) xdr_pmaplist_ptr, (char *)&list_pml);
177 list_pml = tmp_pmapl;
178#endif
179}
168#endif
169 if (ok2 == FALSE) {
170 xdr_free((xdrproc_t) xdr_rpcblist_ptr, (char *)&tmp_rpcbl);
171 return;
172 }
173 xdr_free((xdrproc_t) xdr_rpcblist_ptr, (char *)&list_rbl);
174 list_rbl = tmp_rpcbl;
175#ifdef PORTMAP
176 xdr_free((xdrproc_t) xdr_pmaplist_ptr, (char *)&list_pml);
177 list_pml = tmp_pmapl;
178#endif
179}