Patch against RTEMS-ss-20030128

Author: Till Straumann <strauman@slac.stanford.edu>

2003/2/11

This patch addresses the following issues:
2003-02-20	Till Straumann <strauman@slac.stanford.edu>

	PR 349/bsps
	* src/mount.c, src/privateenv.c:
  	    - mount() bugfix: allocated 'loc' node must be released if
			mount fails due to missing node_type_h
	    - silence compiler warning about improper pointer type

Index: cpukit/libcsupport/src/mount.c
===================================================================
RCS file: /afs/slac/g/spear/cvsrep/rtems/src-20030128/cpukit/libcsupport/src/mount.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 mount.c
*** cpukit/libcsupport/src/mount.c	29 Jan 2003 22:57:19 -0000	1.1.1.2
--- cpukit/libcsupport/src/mount.c	7 Feb 2003 20:47:49 -0000
***************
*** 142,147 ****
--- 142,149 ----
              mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 )
        goto cleanup_and_bail;

+     loc_to_free = &loc;
+
      /*
       * Test for node_type_h
       */
***************
*** 155,161 ****
       *  Test to see if it is a directory
       */

-     loc_to_free = &loc;
      if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
        errno = ENOTDIR;
        goto cleanup_and_bail;
--- 157,162 ----
Index: cpukit/libcsupport/src/privateenv.c
===================================================================
RCS file: /afs/slac/g/spear/cvsrep/rtems/src-20030128/cpukit/libcsupport/src/privateenv.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 privateenv.c
*** cpukit/libcsupport/src/privateenv.c	29 Jan 2003 22:57:20 -0000	1.1.1.3
--- cpukit/libcsupport/src/privateenv.c	30 Jan 2003 18:01:40 -0000
***************
*** 65,71 ****
     tmp->refcnt = 1;
  #endif

!    sc = rtems_task_variable_add(RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env);
     if (sc != RTEMS_SUCCESSFUL) {
  	 /* don't use free_user_env because the pathlocs are
  	  * not initialized yet
--- 65,71 ----
     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
This commit is contained in:
Joel Sherrill
2003-02-20 22:09:50 +00:00
parent d49389adb9
commit 8860f103a5
3 changed files with 69 additions and 2 deletions

View File

@@ -1,3 +1,69 @@
Patch against RTEMS-ss-20030128
Author: Till Straumann <strauman@slac.stanford.edu>
2003/2/11
This patch addresses the following issues:
2003-02-20 Till Straumann <strauman@slac.stanford.edu>
PR 349/bsps
* src/mount.c, src/privateenv.c:
- mount() bugfix: allocated 'loc' node must be released if
mount fails due to missing node_type_h
- silence compiler warning about improper pointer type
Index: cpukit/libcsupport/src/mount.c
===================================================================
RCS file: /afs/slac/g/spear/cvsrep/rtems/src-20030128/cpukit/libcsupport/src/mount.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 mount.c
*** cpukit/libcsupport/src/mount.c 29 Jan 2003 22:57:19 -0000 1.1.1.2
--- cpukit/libcsupport/src/mount.c 7 Feb 2003 20:47:49 -0000
***************
*** 142,147 ****
--- 142,149 ----
mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 )
goto cleanup_and_bail;
+ loc_to_free = &loc;
+
/*
* Test for node_type_h
*/
***************
*** 155,161 ****
* Test to see if it is a directory
*/
- loc_to_free = &loc;
if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
errno = ENOTDIR;
goto cleanup_and_bail;
--- 157,162 ----
Index: cpukit/libcsupport/src/privateenv.c
===================================================================
RCS file: /afs/slac/g/spear/cvsrep/rtems/src-20030128/cpukit/libcsupport/src/privateenv.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 privateenv.c
*** cpukit/libcsupport/src/privateenv.c 29 Jan 2003 22:57:20 -0000 1.1.1.3
--- cpukit/libcsupport/src/privateenv.c 30 Jan 2003 18:01:40 -0000
***************
*** 65,71 ****
tmp->refcnt = 1;
#endif
! sc = rtems_task_variable_add(RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env);
if (sc != RTEMS_SUCCESSFUL) {
/* don't use free_user_env because the pathlocs are
* not initialized yet
--- 65,71 ----
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
2003-02-20 Wolfram Wadepohl <W.Wadepohl@indumat.de>
PR 357/rtems_misc

View File

@@ -142,6 +142,8 @@ int mount(
mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 )
goto cleanup_and_bail;
loc_to_free = &loc;
/*
* Test for node_type_h
*/
@@ -155,7 +157,6 @@ int mount(
* Test to see if it is a directory
*/
loc_to_free = &loc;
if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
errno = ENOTDIR;
goto cleanup_and_bail;

View File

@@ -65,7 +65,7 @@ rtems_status_code rtems_libio_set_private_env(void) {
tmp->refcnt = 1;
#endif
sc = rtems_task_variable_add(RTEMS_SELF,(void*)&rtems_current_user_env,free_user_env);
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