<!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-07-15)</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>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-07-15 Joel Sherrill <joel.sherrill@oarcorp.com>

        * libcsupport/src/privateenv.c: Fix bug.
</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.2511&r2=text&tr2=1.2512&diff_format=h">M</a></td><td width='1%'>1.2512</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/privateenv.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/libcsupport/src/privateenv.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2511 rtems/cpukit/ChangeLog:1.2512
--- rtems/cpukit/ChangeLog:1.2511       Thu Jul 15 10:44:39 2010
+++ rtems/cpukit/ChangeLog      Thu Jul 15 16:31:09 2010
</font><font color='#997700'>@@ -1,3 +1,7 @@
</font><font color='#000088'>+2010-07-15    Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * libcsupport/src/privateenv.c: Fix bug.
+
</font> 2010-07-15        Sebastian Huber <Sebastian.Huber@embedded-brains.de>
 
        PR 1607/cpukit

<font color='#006600'>diff -u rtems/cpukit/libcsupport/src/privateenv.c:1.12 rtems/cpukit/libcsupport/src/privateenv.c:1.13
--- rtems/cpukit/libcsupport/src/privateenv.c:1.12      Mon May 31 08:56:36 2010
+++ rtems/cpukit/libcsupport/src/privateenv.c   Thu Jul 15 16:31:10 2010
</font><font color='#997700'>@@ -3,7 +3,7 @@
</font>  *
  *  Submitted by: fernando.ruiz@ctv.es (correo@fernando-ruiz.com)
  *
<font color='#880000'>- *  COPYRIGHT (c) 1989-2000.
</font><font color='#000088'>+ *  COPYRIGHT (c) 1989-2010.
</font>  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
<font color='#997700'>@@ -17,7 +17,7 @@
</font> #include "config.h"
 #endif
 
<font color='#880000'>-#include <stdlib.h>  /* free */
</font><font color='#000088'>+#include <stdlib.h> /* free */
</font> 
 #include <rtems.h>
 #include <rtems/chain.h>
<font color='#997700'>@@ -33,28 +33,29 @@
</font> {
   rtems_user_env_t *env = (rtems_user_env_t*) venv ;
 
<font color='#880000'>-   if (env != &rtems_global_user_env
</font><font color='#000088'>+ if (env != &rtems_global_user_env
</font> #ifdef HAVE_USERENV_REFCNT
<font color='#880000'>-           && --env->refcnt <= 0
</font><font color='#000088'>+  && --env->refcnt <= 0
</font> #endif
<font color='#880000'>-           ) {
-               rtems_filesystem_freenode( &env->current_directory);
-               rtems_filesystem_freenode( &env->root_directory);
-               free(env);
-       }
</font><font color='#000088'>+  ) {
+  rtems_filesystem_freenode( &env->current_directory);
+  rtems_filesystem_freenode( &env->root_directory);
+  free(env);
+ }
</font> }
 
<font color='#880000'>-rtems_status_code rtems_libio_set_private_env(void) {
-  rtems_status_code<span style="background-color: #FF0000"> </span>                                      sc;
-  rtems_id<span style="background-color: #FF0000">          </span>                                      task_id;
-  rtems_filesystem_location_info_t             loc;
</font><font color='#000088'>+rtems_status_code rtems_libio_set_private_env(void)
+{
+  rtems_status_code      sc;
+  rtems_id               task_id;
+  rtems_filesystem_location_info_t  loc;
</font> 
   sc=rtems_task_ident(RTEMS_SELF,0,&task_id);
   if (sc != RTEMS_SUCCESSFUL) return sc;
 
   /* Only for the first time a malloc is necesary */
   if (rtems_current_user_env==&rtems_global_user_env) {
<font color='#880000'>-   rtems_user_env_t        *tmp = malloc(sizeof(rtems_user_env_t));
</font><font color='#000088'>+   rtems_user_env_t *tmp = malloc(sizeof(rtems_user_env_t));
</font>    if (!tmp)
      return RTEMS_NO_MEMORY;
 
<font color='#997700'>@@ -62,16 +63,20 @@
</font>    tmp->refcnt = 1;
 #endif
 
<font color='#880000'>-   sc = rtems_task_variable_add(RTEMS_SELF,(void*)&rtems_current_user_env,(void(*)(void *))free_user_env);
</font><font color='#000088'>+   sc = rtems_task_variable_add(
+    RTEMS_SELF,
+    (void*)&rtems_current_user_env,
+    (void(*)(void *))free_user_env
+   );
</font>    if (sc != RTEMS_SUCCESSFUL) {
<font color='#880000'>-    /* don't use free_user_env because the pathlocs are
-         * not initialized yet
-         */
</font><font color='#000088'>+    /* don't use free_user_env because the pathlocs are
+     * not initialized yet
+     */
</font>      free(tmp);
      return sc;
    }
    rtems_current_user_env = tmp;
<font color='#880000'>-  };
</font><font color='#000088'>+  }
</font> 
   *rtems_current_user_env = rtems_global_user_env; /* get the global values*/
   rtems_current_user_env->task_id=task_id;         /* mark the local values*/
<font color='#997700'>@@ -111,7 +116,8 @@
</font>  */
 
 #ifndef HAVE_USERENV_REFCNT
<font color='#880000'>-rtems_status_code rtems_libio_share_private_env(rtems_id task_id) {
</font><font color='#000088'>+rtems_status_code rtems_libio_share_private_env(rtems_id task_id)
+{
</font>   rtems_status_code  sc;
   rtems_user_env_t * shared_user_env;
   rtems_id           current_task_id;
<font color='#997700'>@@ -121,20 +127,21 @@
</font> 
   if (rtems_current_user_env->task_id==current_task_id) {
    /* kill the current user env & task_var*/
<font color='#880000'>-   rtems_user_env_t<span style="background-color: #FF0000"> </span>  *tmp = rtems_current_user_env;
</font><font color='#000088'>+   rtems_user_env_t  *tmp = rtems_current_user_env;
</font>    sc = rtems_task_variable_delete(RTEMS_SELF,(void*)&rtems_current_user_env);
    if (sc != RTEMS_SUCCESSFUL) return sc;
    free_user_env(tmp);
<font color='#880000'>-  };
</font><font color='#000088'>+  } else {
+    sc = rtems_task_variable_get(
+      task_id,(void*)&rtems_current_user_env, (void*)&shared_user_env );
+    if (sc != RTEMS_SUCCESSFUL)
+      goto bailout;
+  }
</font> 
   /* AT THIS POINT, rtems_current_user_env is DANGLING */
 
<font color='#880000'>-  sc = rtems_task_variable_get(task_id,(void*)&rtems_current_user_env,
-                                      (void*)&shared_user_env       );
-  if (sc != RTEMS_SUCCESSFUL)
-    goto bailout;
-
-  sc = rtems_task_variable_add(RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env);
</font><font color='#000088'>+  sc = rtems_task_variable_add(
+    RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env);
</font>   if (sc != RTEMS_SUCCESSFUL)
     goto bailout;
 
</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>