summaryrefslogtreecommitdiffstats
path: root/lib/libc/xdr/xdr_stdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/xdr/xdr_stdio.c')
-rw-r--r--lib/libc/xdr/xdr_stdio.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/lib/libc/xdr/xdr_stdio.c b/lib/libc/xdr/xdr_stdio.c
index 5cfdf20..64b0b82 100644
--- a/lib/libc/xdr/xdr_stdio.c
+++ b/lib/libc/xdr/xdr_stdio.c
@@ -30,7 +30,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)xdr_stdio.c 1.16 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)xdr_stdio.c 2.1 88/07/29 4.0 RPCSRC";*/
-static char *rcsid = "$Id: xdr_stdio.c,v 1.1 1994/08/07 18:39:35 wollman Exp $";
+static char *rcsid = "$Id: xdr_stdio.c,v 1.2 1995/05/30 05:42:12 rgrimes Exp $";
#endif
/*
@@ -53,7 +53,7 @@ static bool_t xdrstdio_getbytes();
static bool_t xdrstdio_putbytes();
static u_int xdrstdio_getpos();
static bool_t xdrstdio_setpos();
-static long * xdrstdio_inline();
+static int32_t *xdrstdio_inline();
static void xdrstdio_destroy();
/*
@@ -99,7 +99,7 @@ xdrstdio_destroy(xdrs)
{
(void)fflush((FILE *)xdrs->x_private);
/* xx should we close the file ?? */
-};
+}
static bool_t
xdrstdio_getlong(xdrs, lp)
@@ -107,11 +107,10 @@ xdrstdio_getlong(xdrs, lp)
register long *lp;
{
- if (fread((caddr_t)lp, sizeof(long), 1, (FILE *)xdrs->x_private) != 1)
+ if (fread((caddr_t)lp, sizeof(int32_t), 1,
+ (FILE *)xdrs->x_private) != 1)
return (FALSE);
-#ifndef mc68000
- *lp = ntohl(*lp);
-#endif
+ *lp = (long)ntohl((int32_t)*lp);
return (TRUE);
}
@@ -121,11 +120,10 @@ xdrstdio_putlong(xdrs, lp)
long *lp;
{
-#ifndef mc68000
- long mycopy = htonl(*lp);
- lp = &mycopy;
-#endif
- if (fwrite((caddr_t)lp, sizeof(long), 1, (FILE *)xdrs->x_private) != 1)
+ long mycopy = (long)htonl((int32_t)*lp);
+
+ if (fwrite((caddr_t)&mycopy, sizeof(int32_t), 1,
+ (FILE *)xdrs->x_private) != 1)
return (FALSE);
return (TRUE);
}
@@ -172,7 +170,7 @@ xdrstdio_setpos(xdrs, pos)
FALSE : TRUE);
}
-static long *
+static int32_t *
xdrstdio_inline(xdrs, len)
XDR *xdrs;
u_int len;
OpenPOWER on IntegriCloud