Deleted Added
full compact
ypxfrd_getmap.c (50476) ypxfrd_getmap.c (90297)
1/*
2 * Copyright (c) 1995, 1996
3 * Bill Paul <wpaul@ctr.columbia.edu>. 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

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

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#ifndef lint
34static const char rcsid[] =
1/*
2 * Copyright (c) 1995, 1996
3 * Bill Paul <wpaul@ctr.columbia.edu>. 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

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

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#ifndef lint
34static const char rcsid[] =
35 "$FreeBSD: head/libexec/ypxfr/ypxfrd_getmap.c 50476 1999-08-28 00:22:10Z peter $";
35 "$FreeBSD: head/libexec/ypxfr/ypxfrd_getmap.c 90297 2002-02-06 13:30:31Z des $";
36#endif /* not lint */
37
38#include <errno.h>
39#include <stdlib.h>
40#include <string.h>
41#include <time.h>
42#include <unistd.h>
43#include <rpcsvc/ypxfrd.h>

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

48#include <sys/stat.h>
49#include <sys/types.h>
50#include "ypxfr_extern.h"
51
52int fp = 0;
53
54static bool_t xdr_my_xfr(register XDR *xdrs, xfr *objp)
55{
36#endif /* not lint */
37
38#include <errno.h>
39#include <stdlib.h>
40#include <string.h>
41#include <time.h>
42#include <unistd.h>
43#include <rpcsvc/ypxfrd.h>

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

48#include <sys/stat.h>
49#include <sys/types.h>
50#include "ypxfr_extern.h"
51
52int fp = 0;
53
54static bool_t xdr_my_xfr(register XDR *xdrs, xfr *objp)
55{
56 while(1) {
56 while (1) {
57 if (!xdr_xfr(xdrs, objp))
58 return(FALSE);
59 if (objp->ok == TRUE) {
60 if (write(fp, objp->xfr_u.xfrblock_buf.xfrblock_buf_val,
61 objp->xfr_u.xfrblock_buf.xfrblock_buf_len) == -1) {
62 yp_error("write failed: %s", strerror(errno));
63 return(FALSE);
64 }
65 }
66 xdr_free(xdr_xfr, (char *)objp);
67 if (objp->ok == FALSE) {
57 if (!xdr_xfr(xdrs, objp))
58 return(FALSE);
59 if (objp->ok == TRUE) {
60 if (write(fp, objp->xfr_u.xfrblock_buf.xfrblock_buf_val,
61 objp->xfr_u.xfrblock_buf.xfrblock_buf_len) == -1) {
62 yp_error("write failed: %s", strerror(errno));
63 return(FALSE);
64 }
65 }
66 xdr_free(xdr_xfr, (char *)objp);
67 if (objp->ok == FALSE) {
68 switch(objp->xfr_u.xfrstat) {
68 switch (objp->xfr_u.xfrstat) {
69 case(XFR_DONE):
70 return(TRUE);
71 break;
72 case(XFR_READ_ERR):
73 yp_error("got read error from rpc.ypxfrd");
74 return(FALSE);
75 break;
76 case(XFR_ACCESS):

--- 70 unchanged lines hidden ---
69 case(XFR_DONE):
70 return(TRUE);
71 break;
72 case(XFR_READ_ERR):
73 yp_error("got read error from rpc.ypxfrd");
74 return(FALSE);
75 break;
76 case(XFR_ACCESS):

--- 70 unchanged lines hidden ---