<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-05-26)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>ralf</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-05-26 Ralf Corsépius <ralf.corsepius@rtems.org>

        * librpc/src/rpc/clnt_tcp.c: Partial merger from freebsd
        (Fix strict-aliasing).
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2304&r2=text&tr2=1.2305&diff_format=h">M</a></td><td width='1%'>1.2305</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/librpc/src/rpc/clnt_tcp.c.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>cpukit/librpc/src/rpc/clnt_tcp.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2304 rtems/cpukit/ChangeLog:1.2305
--- rtems/cpukit/ChangeLog:1.2304       Tue May 25 22:41:49 2010
+++ rtems/cpukit/ChangeLog      Tue May 25 23:15:02 2010
</font><font color='#997700'>@@ -1,5 +1,10 @@
</font> 2010-05-26        Ralf Corsépius <ralf.corsepius@rtems.org>
 
<font color='#000088'>+   * librpc/src/rpc/clnt_tcp.c: Partial merger from freebsd
+       (Fix strict-aliasing).
+
+2010-05-26     Ralf Corsépius <ralf.corsepius@rtems.org>
+
</font>   * librpc/src/rpc/clnt_raw.c: Partial merger from freebsd
        (Improved 16 bit compatibility; Fix strict-aliasing).
 

<font color='#006600'>diff -u rtems/cpukit/librpc/src/rpc/clnt_tcp.c:1.12 rtems/cpukit/librpc/src/rpc/clnt_tcp.c:1.13
--- rtems/cpukit/librpc/src/rpc/clnt_tcp.c:1.12 Sat Mar 27 21:35:23 2010
+++ rtems/cpukit/librpc/src/rpc/clnt_tcp.c      Tue May 25 23:15:02 2010
</font><font color='#997700'>@@ -90,14 +90,17 @@
</font> 
 struct ct_data {
        int             ct_sock;
<font color='#880000'>-   bool_t          ct_closeit;
-       struct timeval  ct_wait;
</font><font color='#000088'>+      bool_t          ct_closeit;     /* close it on destroy */
+       struct timeval  ct_wait;        /* wait interval in milliseconds */
</font>   bool_t          ct_waitset;       /* wait set by clnt_control? */
        struct sockaddr_in ct_addr;
        struct rpc_err  ct_error;
<font color='#880000'>-   char            ct_mcall[MCALL_MSG_SIZE];       /* marshalled callmsg */
</font><font color='#000088'>+      union {
+               char    ct_mcallc[MCALL_MSG_SIZE];      /* marshalled callmsg */
+               u_int32_t ct_mcalli;
+       } ct_u;
</font>   u_int           ct_mpos;                        /* pos after marshal */
<font color='#880000'>-   XDR             ct_xdrs;
</font><font color='#000088'>+      XDR             ct_xdrs;        /* XDR stream */
</font> };
 
 /*
<font color='#997700'>@@ -124,7 +127,7 @@
</font>   u_int recvsz)
 {
        CLIENT *h;
<font color='#880000'>-   register struct ct_data *ct = NULL;
</font><font color='#000088'>+      struct ct_data *ct = NULL;      /* client handle */
</font>   struct timeval now;
        struct rpc_msg call_msg;
        static uintptr_t disrupt;
<font color='#997700'>@@ -139,7 +142,7 @@
</font>           rpc_createerr.cf_error.re_errno = errno;
                goto fooy;
        }
<font color='#880000'>-   ct = (struct ct_data *)mem_alloc(sizeof(*ct));
</font><font color='#000088'>+      ct = (struct ct_data *)mem_alloc(sizeof (*ct));
</font>   if (ct == NULL) {
                (void)fprintf(stderr, "clnttcp_create: out of memory\n");
                rpc_createerr.cf_stat = RPC_SYSTEMERROR;
<font color='#997700'>@@ -201,7 +204,7 @@
</font>   /*
         * pre-serialize the static part of the call msg and stash it away
         */
<font color='#880000'>-   xdrmem_create(&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE,
</font><font color='#000088'>+      xdrmem_create(&(ct->ct_xdrs), ct->ct_u.ct_mcallc, MCALL_MSG_SIZE,
</font>       XDR_ENCODE);
        if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
                if (ct->ct_closeit) {
<font color='#997700'>@@ -244,12 +247,12 @@
</font>   caddr_t results_ptr,
        struct timeval timeout)
 {
<font color='#880000'>-   register struct ct_data *ct = (struct ct_data *) h->cl_private;
-       register XDR *xdrs = &(ct->ct_xdrs);
</font><font color='#000088'>+      struct ct_data *ct = (struct ct_data *) h->cl_private;
+       XDR *xdrs = &(ct->ct_xdrs);
</font>   struct rpc_msg reply_msg;
<font color='#880000'>-   u_long x_id;
-       u_int32_t *msg_x_id = (u_int32_t *)(ct->ct_mcall);   /* yuk */
-       register bool_t shipnow;
</font><font color='#000088'>+      u_int32_t x_id;
+       u_int32_t *msg_x_id = &ct->ct_u.ct_mcalli;       /* yuk */
+       bool_t shipnow;
</font>   int refreshes = 2;
 
        if (!ct->ct_waitset) {
<font color='#997700'>@@ -264,7 +267,7 @@
</font>   xdrs->x_op = XDR_ENCODE;
        ct->ct_error.re_status = RPC_SUCCESS;
        x_id = ntohl(--(*msg_x_id));
<font color='#880000'>-   if ((! XDR_PUTBYTES(xdrs, ct->ct_mcall, ct->ct_mpos)) ||
</font><font color='#000088'>+      if ((! XDR_PUTBYTES(xdrs, ct->ct_u.ct_mcallc, ct->ct_mpos)) ||
</font>       (! XDR_PUTLONG(xdrs, (long *)&proc)) ||
            (! AUTH_MARSHALL(h->cl_auth, xdrs)) ||
            (! (*xdr_args)(xdrs, args_ptr))) {
<font color='#997700'>@@ -273,10 +276,12 @@
</font>           (void)xdrrec_endofrecord(xdrs, TRUE);
                return (ct->ct_error.re_status);
        }
<font color='#880000'>-   if (! xdrrec_endofrecord(xdrs, shipnow))
</font><font color='#000088'>+      if (! xdrrec_endofrecord(xdrs, shipnow)) {
</font>           return (ct->ct_error.re_status = RPC_CANTSEND);
<font color='#880000'>-   if (! shipnow)
</font><font color='#000088'>+      }
+       if (! shipnow) {
</font>           return (RPC_SUCCESS);
<font color='#000088'>+   }
</font>   /*
         * Hack to provide rpc-based message passing
         */
<font color='#997700'>@@ -292,7 +297,7 @@
</font>   while (TRUE) {
                reply_msg.acpted_rply.ar_verf = _null_auth;
                reply_msg.acpted_rply.ar_results.where = NULL;
<font color='#880000'>-           reply_msg.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void;
</font><font color='#000088'>+              reply_msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_void;
</font>           if (! xdrrec_skiprecord(xdrs))
                        return (ct->ct_error.re_status);
                /* now decode and validate the response header */
<font color='#997700'>@@ -336,9 +341,9 @@
</font>   CLIENT *h,
        struct rpc_err *errp)
 {
<font color='#880000'>-   register struct ct_data *ct =
-           (struct ct_data *) h->cl_private;
</font><font color='#000088'>+      struct ct_data *ct;
</font> 
<font color='#000088'>+   ct = (struct ct_data *) h->cl_private;
</font>   *errp = ct->ct_error;
 }
 
<font color='#997700'>@@ -348,9 +353,12 @@
</font>   xdrproc_t xdr_res,
        caddr_t res_ptr)
 {
<font color='#880000'>-   register struct ct_data *ct = (struct ct_data *)cl->cl_private;
-       register XDR *xdrs = &(ct->ct_xdrs);
</font><font color='#000088'>+      struct ct_data *ct;
+       XDR *xdrs;
</font> 
<font color='#000088'>+   ct = (struct ct_data *)cl->cl_private;
+       xdrs = &(ct->ct_xdrs);
+<span style="background-color: #FF0000">       </span>
</font>   xdrs->x_op = XDR_FREE;
        return ((*xdr_res)(xdrs, res_ptr));
 }
<font color='#997700'>@@ -367,9 +375,11 @@
</font>   int request,
        char *info)
 {
<font color='#880000'>-   register struct ct_data *ct = (struct ct_data *)cl->cl_private;
-       register struct timeval *tv;
</font><font color='#000088'>+      struct ct_data *ct;
+       struct timeval *tv;
</font>   socklen_t len;
<font color='#000088'>+<span style="background-color: #FF0000">   </span>
+       ct = (struct ct_data *)cl->cl_private;
</font> 
        switch (request) {
        case CLSET_FD_CLOSE:
<font color='#997700'>@@ -404,18 +414,20 @@
</font>   case CLGET_XID:
                /*
                 * use the knowledge that xid is the
<font color='#880000'>-            * first element in the call structure *.
</font><font color='#000088'>+               * first element in the call structure
</font>            * This will get the xid of the PREVIOUS call
                 */
                if (info == NULL)
                        return(FALSE);
<font color='#880000'>-           *(u_long *)info = ntohl(*(u_long *)ct->ct_mcall);
</font><font color='#000088'>+              *(u_int32_t *)info =
+                       ntohl(*(u_int32_t *)&ct->ct_u.ct_mcalli);
</font>           break;
        case CLSET_XID:
                /* This will set the xid of the NEXT call */
                if (info == NULL)
                        return(FALSE);
<font color='#880000'>-           *(u_long *)ct->ct_mcall =  htonl(*(u_long *)info - 1);
</font><font color='#000088'>+              *(u_int32_t *)&ct->ct_u.ct_mcalli =
+                       htonl(*((u_int32_t *)info) + 1);
</font>           /* decrement by 1 as clnttcp_call() increments once */
        case CLGET_VERS:
                /*
<font color='#997700'>@@ -426,38 +438,44 @@
</font>            */
                if (info == NULL)
                        return(FALSE);
<font color='#880000'>-           *(u_long *)info = ntohl(*(u_long *)(ct->ct_mcall +
</font><font color='#000088'>+              *(u_int32_t *)info =
+                       ntohl(*(u_int32_t *)(ct->ct_u.ct_mcallc +
</font>                                           4 * BYTES_PER_XDR_UNIT));
                break;
        case CLSET_VERS:
                if (info == NULL)
                        return(FALSE);
<font color='#880000'>-           *(u_long *)(ct->ct_mcall + 4 * BYTES_PER_XDR_UNIT)
-                               = htonl(*(u_long *)info);
</font><font color='#000088'>+              *(u_int32_t *)(ct->ct_u.ct_mcallc +
+                       4 * BYTES_PER_XDR_UNIT) =
+                       htonl(*(u_int32_t *)info);
</font>           break;
<font color='#000088'>+
</font>   case CLGET_PROG:
                /*
                 * This RELIES on the information that, in the call body,
<font color='#880000'>-            * the program number field is the  field from the
</font><font color='#000088'>+               * the program number field is the fourth field from the
</font>            * begining of the RPC header. MUST be changed if the
                 * call_struct is changed
                 */
                if (info == NULL)
                        return(FALSE);
<font color='#880000'>-           *(u_long *)info = ntohl(*(u_long *)(ct->ct_mcall +
</font><font color='#000088'>+              *(u_int32_t *)info = ntohl(*(u_int32_t *)(ct->ct_u.ct_mcallc +
</font>                                           3 * BYTES_PER_XDR_UNIT));
                break;
<font color='#000088'>+
</font>   case CLSET_PROG:
                if (info == NULL)
                        return(FALSE);
<font color='#880000'>-           *(u_long *)(ct->ct_mcall + 3 * BYTES_PER_XDR_UNIT)
-                               = htonl(*(u_long *)info);
</font><font color='#000088'>+              *(u_int32_t *)(ct->ct_u.ct_mcallc + 3 * BYTES_PER_XDR_UNIT)
+                               = htonl(*(u_int32_t *)info);
</font>           break;
<font color='#000088'>+
</font>   case CLGET_LOCAL_ADDR:
                len = sizeof(struct sockaddr);
                if (getsockname(ct->ct_sock, (struct sockaddr *)info, &len) <0)
                        return(FALSE);
                break;
<font color='#000088'>+
</font>   case CLGET_RETRY_TIMEOUT:
        case CLSET_RETRY_TIMEOUT:
        case CLGET_SVC_ADDR:
<font color='#997700'>@@ -475,15 +493,15 @@
</font> clnttcp_destroy(
        CLIENT *h)
 {
<font color='#880000'>-   register struct ct_data *ct =
</font><font color='#000088'>+      struct ct_data *ct =
</font>       (struct ct_data *) h->cl_private;
 
        if (ct->ct_closeit) {
                (void)_RPC_close(ct->ct_sock);
        }
        XDR_DESTROY(&(ct->ct_xdrs));
<font color='#880000'>-   mem_free((caddr_t)ct, sizeof(struct ct_data));
-       mem_free((caddr_t)h, sizeof(CLIENT));
</font><font color='#000088'>+      mem_free(ct, sizeof(struct ct_data));
+       mem_free(h, sizeof(CLIENT));
</font> }
 
 /*
<font color='#997700'>@@ -574,7 +592,7 @@
</font>   int len)
 {
        struct ct_data *ct = (struct ct_data *) _ct;
<font color='#880000'>-   register int i, cnt;
</font><font color='#000088'>+      int i, cnt;
</font> 
        for (cnt = len; cnt > 0; cnt -= i, buf += i) {
                if ((i = _RPC_write(ct->ct_sock, buf, cnt)) == -1) {
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>