change log for rtems (2010-08-29)

rtems-vc at rtems.org rtems-vc at rtems.org
Sun Aug 29 20:11:28 UTC 2010


 *joel*:
2010-08-29	Joel Sherrill <joel.sherrilL at OARcorp.com>

	* libcsupport/src/getlogin.c: Modify to use strncpy() on all paths.

M 1.2618  cpukit/ChangeLog
M    1.4  cpukit/libcsupport/src/getlogin.c

diff -u rtems/cpukit/ChangeLog:1.2617 rtems/cpukit/ChangeLog:1.2618
--- rtems/cpukit/ChangeLog:1.2617	Sat Aug 28 15:10:00 2010
+++ rtems/cpukit/ChangeLog	Sun Aug 29 14:48:52 2010
@@ -1,3 +1,7 @@
+2010-08-29	Joel Sherrill <joel.sherrilL at OARcorp.com>
+
+	* libcsupport/src/getlogin.c: Modify to use strncpy() on all paths.
+
 2010-08-28	Joel Sherrill <joel.sherrill at oarcorp.com>
 
 	PR 1694/shell

diff -u rtems/cpukit/libcsupport/src/getlogin.c:1.3 rtems/cpukit/libcsupport/src/getlogin.c:1.4
--- rtems/cpukit/libcsupport/src/getlogin.c:1.3	Mon Jul  5 16:31:56 2010
+++ rtems/cpukit/libcsupport/src/getlogin.c	Sun Aug 29 14:48:52 2010
@@ -41,6 +41,7 @@
 )
 {
   struct passwd *pw;
+  char          *pname;
 
   if ( !name ) 
     return EFAULT;
@@ -48,11 +49,13 @@
   if ( namesize < LOGIN_NAME_MAX )
     return ERANGE;
 
+  /* Set the pointer to a default name */
+  pname = "";
+
   pw = getpwuid(getuid());
-  if ( !pw ) {
-   strcpy( name, "" );
-  } else {
-   strncpy( name, pw->pw_name, LOGIN_NAME_MAX );
-  }
+  if ( pw )
+   pname = pw->pw_name;
+
+  strncpy( name, pname, LOGIN_NAME_MAX );
   return 0;
 }


 *joel*:
2010-08-29	Joel Sherrill <joel.sherrilL at OARcorp.com>

	* libcsupport/src/privateenv.c: Add macro to test status when
	RTEMS_DEBUG is enabled. Note than evaluation of root directory should
	always work.

M 1.2619  cpukit/ChangeLog
M   1.16  cpukit/libcsupport/src/privateenv.c

diff -u rtems/cpukit/ChangeLog:1.2618 rtems/cpukit/ChangeLog:1.2619
--- rtems/cpukit/ChangeLog:1.2618	Sun Aug 29 14:48:52 2010
+++ rtems/cpukit/ChangeLog	Sun Aug 29 14:49:52 2010
@@ -1,5 +1,11 @@
 2010-08-29	Joel Sherrill <joel.sherrilL at OARcorp.com>
 
+	* libcsupport/src/privateenv.c: Add macro to test status when
+	RTEMS_DEBUG is enabled. Note than evaluation of root directory should
+	always work.
+
+2010-08-29	Joel Sherrill <joel.sherrilL at OARcorp.com>
+
 	* libcsupport/src/getlogin.c: Modify to use strncpy() on all paths.
 
 2010-08-28	Joel Sherrill <joel.sherrill at oarcorp.com>

diff -u rtems/cpukit/libcsupport/src/privateenv.c:1.15 rtems/cpukit/libcsupport/src/privateenv.c:1.16
--- rtems/cpukit/libcsupport/src/privateenv.c:1.15	Thu Jul 29 17:27:12 2010
+++ rtems/cpukit/libcsupport/src/privateenv.c	Sun Aug 29 14:49:52 2010
@@ -24,6 +24,13 @@
 #include <rtems/libio.h>
 #include <rtems/libio_.h>
 
+#if defined(RTEMS_DEBUG)
+   #define CHECK_STATUS(_x) assert((_x) == )
+   #include <assert.h>
+#else
+   #define CHECK_STATUS(_x) _x
+#endif
+
 /* cleanup a user environment
  * NOTE: this must be called with
  *       thread dispatching disabled!
@@ -33,15 +40,15 @@
 {
   rtems_user_env_t *env = (rtems_user_env_t*) venv ;
 
- if (env != &rtems_global_user_env
-#ifdef HAVE_USERENV_REFCNT
-  && --env->refcnt <= 0
-#endif
+  if (env != &rtems_global_user_env
+  #ifdef HAVE_USERENV_REFCNT
+      && --env->refcnt <= 0
+  #endif
   ) {
-  rtems_filesystem_freenode( &env->current_directory);
-  rtems_filesystem_freenode( &env->root_directory);
-  free(env);
- }
+    rtems_filesystem_freenode( &env->current_directory);
+    rtems_filesystem_freenode( &env->root_directory);
+    free(env);
+  }
 }
 
 rtems_status_code rtems_libio_set_private_env(void)
@@ -67,50 +74,53 @@
 
   if (rtems_current_user_env==&rtems_global_user_env || 
       rtems_current_user_env->task_id != task_id ) {
-   rtems_user_env_t *tmp = malloc(sizeof(rtems_user_env_t));
-   if (!tmp)
-     return RTEMS_NO_MEMORY;
-
-#ifdef HAVE_USERENV_REFCNT
-   tmp->refcnt = 1;
-#endif
-
-   sc = rtems_task_variable_add(
-    RTEMS_SELF,
-    (void*)&rtems_current_user_env,
-    (void(*)(void *))free_user_env
-   );
-   if (sc != RTEMS_SUCCESSFUL) {
-    /* don't use free_user_env because the pathlocs are
-     * not initialized yet
-     */
-     free(tmp);
-     return sc;
-   }
-   rtems_current_user_env = tmp;
+    rtems_user_env_t *tmp = malloc(sizeof(rtems_user_env_t));
+    if (!tmp)
+      return RTEMS_NO_MEMORY;
+
+    #ifdef HAVE_USERENV_REFCNT
+      tmp->refcnt = 1;
+    #endif
+
+    sc = rtems_task_variable_add(
+      RTEMS_SELF,
+      (void*)&rtems_current_user_env,
+      (void(*)(void *))free_user_env
+    );
+    if (sc != RTEMS_SUCCESSFUL) {
+      /* don't use free_user_env because the pathlocs are
+       * not initialized yet
+       */
+       free(tmp);
+       return sc;
+     }
+     rtems_current_user_env = tmp;
   }
 
   *rtems_current_user_env = rtems_global_user_env; /* get the global values*/
   rtems_current_user_env->task_id=task_id;         /* mark the local values*/
 
-  /* Clone the pathlocs. In contrast to most other
-   * code we must _not_ free the original locs because
-   * what we are trying to do here is forking off
-   * clones. The reason is a pathloc can be allocated by the
-   * file system and needs to be freed when deleting the environment.
+  /*  Clone the pathlocs. In contrast to most other code we must _not_
+   *  free the original locs because what we are trying to do here is forking
+   *  off clones. The reason is a pathloc can be allocated by the file system
+   *  and needs to be freed when deleting the environment.
+   *
+   *  NOTE: Evaluation should always work so only check status when debug
+   *        is enabled.
    */
 
-  rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
+  CHECK_STATUS( rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0) );
   rtems_filesystem_root    = loc;
-  rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0);
+
+  CHECK_STATUS( rtems_filesystem_evaluate_path("/", 1, 0, &loc, 0) );
   rtems_filesystem_current = loc;
 
   return RTEMS_SUCCESSFUL;
 }
 
 /*
- *  Share a same private environment beetween two task:
- *   Task_id (remote) and RTEMS_SELF(current).
+ *  Share the same private environment between two tasks:
+ *      Task_id (remote) and RTEMS_SELF(current).
  */
 
 /* NOTE:


 *joel*:
2010-08-29	Joel Sherrill <joel.sherrilL at OARcorp.com>

	* posix/src/killinfo.c: Ensure interested is non-NULL before using it.

M 1.2620  cpukit/ChangeLog
M   1.26  cpukit/posix/src/killinfo.c

diff -u rtems/cpukit/ChangeLog:1.2619 rtems/cpukit/ChangeLog:1.2620
--- rtems/cpukit/ChangeLog:1.2619	Sun Aug 29 14:49:52 2010
+++ rtems/cpukit/ChangeLog	Sun Aug 29 14:50:33 2010
@@ -1,5 +1,9 @@
 2010-08-29	Joel Sherrill <joel.sherrilL at OARcorp.com>
 
+	* posix/src/killinfo.c: Ensure interested is non-NULL before using it.
+
+2010-08-29	Joel Sherrill <joel.sherrilL at OARcorp.com>
+
 	* libcsupport/src/privateenv.c: Add macro to test status when
 	RTEMS_DEBUG is enabled. Note than evaluation of root directory should
 	always work.

diff -u rtems/cpukit/posix/src/killinfo.c:1.25 rtems/cpukit/posix/src/killinfo.c:1.26
--- rtems/cpukit/posix/src/killinfo.c:1.25	Mon Jun 28 19:34:10 2010
+++ rtems/cpukit/posix/src/killinfo.c	Sun Aug 29 14:50:33 2010
@@ -265,7 +265,7 @@
        *  If the interested thread is ready, don't think about changing.
        */
 
-      if ( !_States_Is_ready( interested->current_state ) ) {
+      if ( interested && !_States_Is_ready( interested->current_state ) ) {
         /* preferred ready over blocked */
         DEBUG_STEP("5");
         if ( _States_Is_ready( the_thread->current_state ) ) {



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100829/7f6e5214/attachment.html>


More information about the vc mailing list