Changeset 2f87c843 in rtems
- Timestamp:
- 02/05/99 00:28:43 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- ecec2ba
- Parents:
- e824fa5
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libcsupport/src/mount.c
re824fa5 r2f87c843 102 102 103 103 /* 104 * Are the file system options valid? 105 */ 106 107 options = get_file_system_options( fsoptions ); 108 if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ){ 104 * Is there a file system operations table? 105 */ 106 107 if ( fs_ops == NULL ) { 109 108 errno = EINVAL; 110 109 return -1; … … 112 111 113 112 /* 114 * Is the file system typevalid?115 */ 116 117 if ( fs _ops == NULL ){113 * Are the file system options valid? 114 */ 115 116 if ( fsoptions == NULL ) { 118 117 errno = EINVAL; 119 118 return -1; 120 119 } 121 120 121 options = get_file_system_options( fsoptions ); 122 if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ) { 123 errno = EINVAL; 124 return -1; 125 } 126 122 127 /* 123 128 * Allocate a mount table entry … … 125 130 126 131 temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) ); 132 133 if ( !temp_mt_entry ) { 134 errno = ENOMEM; 135 return -1; 136 } 127 137 128 138 temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry; 129 139 temp_mt_entry->options = options; 130 if ( device )131 140 if ( device ) 141 sprintf( temp_mt_entry->dev, "%s", device ); 132 142 else 133 143 temp_mt_entry->dev = 0; 134 144 135 145 /* … … 150 160 */ 151 161 152 if ( temp_loc.ops->node_type( &temp_loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {162 if ( temp_loc.ops->node_type( &temp_loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 153 163 errno = ENOTDIR; 154 164 goto cleanup_and_bail; … … 159 169 */ 160 170 161 if ( search_mt_for_mount_point( &temp_loc ) == FOUND ) {171 if ( search_mt_for_mount_point( &temp_loc ) == FOUND ) { 162 172 errno = EBUSY; 163 173 goto cleanup_and_bail; … … 180 190 181 191 if ( !temp_loc.ops->mount ){ 182 errno = ENOTSUP;183 goto cleanup_and_bail;192 errno = ENOTSUP; 193 goto cleanup_and_bail; 184 194 } 185 195 … … 283 293 ) 284 294 { 285 Chain_Node *the_node;295 Chain_Node *the_node; 286 296 rtems_filesystem_mount_table_entry_t *the_mount_entry; 287 297 -
c/src/exec/libcsupport/src/open.c
re824fa5 r2f87c843 103 103 * See if the file exists. 104 104 */ 105 106 107 status = rtems_filesystem_evaluate_path(pathname, eval_flags, &temp_loc, TRUE );105 106 status = rtems_filesystem_evaluate_path( 107 pathname, eval_flags, &temp_loc, TRUE ); 108 108 109 109 if ( status == -1 ) { -
c/src/exec/libfs/src/imfs/imfs_eval.c
re824fa5 r2f87c843 71 71 int flags_to_test; 72 72 73 if ( !rtems_libio_is_valid_perms( flags ) ) {73 if ( !rtems_libio_is_valid_perms( flags ) ) { 74 74 assert( 0 ); 75 75 set_errno_and_return_minus_one( EIO ); … … 142 142 */ 143 143 144 if ( !IMFS_evaluate_permission( node, flags ) )144 if ( !IMFS_evaluate_permission( node, flags ) ) 145 145 set_errno_and_return_minus_one( EACCES ); 146 146 … … 204 204 */ 205 205 206 if ( !IMFS_evaluate_permission( node, flags ) )206 if ( !IMFS_evaluate_permission( node, flags ) ) 207 207 set_errno_and_return_minus_one( EACCES ); 208 208 … … 308 308 if ( type != IMFS_NO_MORE_PATH ) 309 309 if ( node->type == IMFS_DIRECTORY ) 310 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )310 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 311 311 set_errno_and_return_minus_one( EACCES ); 312 312 … … 423 423 424 424 for( ; path[i] != '\0'; i++) { 425 if ( !IMFS_is_separator( path[ i ] ) )425 if ( !IMFS_is_separator( path[ i ] ) ) 426 426 set_errno_and_return_minus_one( ENOENT ); 427 427 } … … 444 444 */ 445 445 446 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) )446 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 447 447 set_errno_and_return_minus_one( EACCES ); 448 448 … … 473 473 int result; 474 474 475 if ( !rtems_libio_is_valid_perms( flags ) ) {475 if ( !rtems_libio_is_valid_perms( flags ) ) { 476 476 assert( 0 ); 477 477 set_errno_and_return_minus_one( EIO ); … … 502 502 if ( type != IMFS_NO_MORE_PATH ) 503 503 if ( node->type == IMFS_DIRECTORY ) 504 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )504 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 505 505 set_errno_and_return_minus_one( EACCES ); 506 506 … … 623 623 */ 624 624 625 if ( !IMFS_evaluate_permission( pathloc, flags ) )625 if ( !IMFS_evaluate_permission( pathloc, flags ) ) 626 626 set_errno_and_return_minus_one( EACCES ); 627 627 -
c/src/lib/libc/imfs_eval.c
re824fa5 r2f87c843 71 71 int flags_to_test; 72 72 73 if ( !rtems_libio_is_valid_perms( flags ) ) {73 if ( !rtems_libio_is_valid_perms( flags ) ) { 74 74 assert( 0 ); 75 75 set_errno_and_return_minus_one( EIO ); … … 142 142 */ 143 143 144 if ( !IMFS_evaluate_permission( node, flags ) )144 if ( !IMFS_evaluate_permission( node, flags ) ) 145 145 set_errno_and_return_minus_one( EACCES ); 146 146 … … 204 204 */ 205 205 206 if ( !IMFS_evaluate_permission( node, flags ) )206 if ( !IMFS_evaluate_permission( node, flags ) ) 207 207 set_errno_and_return_minus_one( EACCES ); 208 208 … … 308 308 if ( type != IMFS_NO_MORE_PATH ) 309 309 if ( node->type == IMFS_DIRECTORY ) 310 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )310 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 311 311 set_errno_and_return_minus_one( EACCES ); 312 312 … … 423 423 424 424 for( ; path[i] != '\0'; i++) { 425 if ( !IMFS_is_separator( path[ i ] ) )425 if ( !IMFS_is_separator( path[ i ] ) ) 426 426 set_errno_and_return_minus_one( ENOENT ); 427 427 } … … 444 444 */ 445 445 446 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) )446 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 447 447 set_errno_and_return_minus_one( EACCES ); 448 448 … … 473 473 int result; 474 474 475 if ( !rtems_libio_is_valid_perms( flags ) ) {475 if ( !rtems_libio_is_valid_perms( flags ) ) { 476 476 assert( 0 ); 477 477 set_errno_and_return_minus_one( EIO ); … … 502 502 if ( type != IMFS_NO_MORE_PATH ) 503 503 if ( node->type == IMFS_DIRECTORY ) 504 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )504 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 505 505 set_errno_and_return_minus_one( EACCES ); 506 506 … … 623 623 */ 624 624 625 if ( !IMFS_evaluate_permission( pathloc, flags ) )625 if ( !IMFS_evaluate_permission( pathloc, flags ) ) 626 626 set_errno_and_return_minus_one( EACCES ); 627 627 -
c/src/lib/libc/mount.c
re824fa5 r2f87c843 102 102 103 103 /* 104 * Are the file system options valid? 105 */ 106 107 options = get_file_system_options( fsoptions ); 108 if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ){ 104 * Is there a file system operations table? 105 */ 106 107 if ( fs_ops == NULL ) { 109 108 errno = EINVAL; 110 109 return -1; … … 112 111 113 112 /* 114 * Is the file system typevalid?115 */ 116 117 if ( fs _ops == NULL ){113 * Are the file system options valid? 114 */ 115 116 if ( fsoptions == NULL ) { 118 117 errno = EINVAL; 119 118 return -1; 120 119 } 121 120 121 options = get_file_system_options( fsoptions ); 122 if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ) { 123 errno = EINVAL; 124 return -1; 125 } 126 122 127 /* 123 128 * Allocate a mount table entry … … 125 130 126 131 temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) ); 132 133 if ( !temp_mt_entry ) { 134 errno = ENOMEM; 135 return -1; 136 } 127 137 128 138 temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry; 129 139 temp_mt_entry->options = options; 130 if ( device )131 140 if ( device ) 141 sprintf( temp_mt_entry->dev, "%s", device ); 132 142 else 133 143 temp_mt_entry->dev = 0; 134 144 135 145 /* … … 150 160 */ 151 161 152 if ( temp_loc.ops->node_type( &temp_loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {162 if ( temp_loc.ops->node_type( &temp_loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 153 163 errno = ENOTDIR; 154 164 goto cleanup_and_bail; … … 159 169 */ 160 170 161 if ( search_mt_for_mount_point( &temp_loc ) == FOUND ) {171 if ( search_mt_for_mount_point( &temp_loc ) == FOUND ) { 162 172 errno = EBUSY; 163 173 goto cleanup_and_bail; … … 180 190 181 191 if ( !temp_loc.ops->mount ){ 182 errno = ENOTSUP;183 goto cleanup_and_bail;192 errno = ENOTSUP; 193 goto cleanup_and_bail; 184 194 } 185 195 … … 283 293 ) 284 294 { 285 Chain_Node *the_node;295 Chain_Node *the_node; 286 296 rtems_filesystem_mount_table_entry_t *the_mount_entry; 287 297 -
c/src/lib/libc/open.c
re824fa5 r2f87c843 103 103 * See if the file exists. 104 104 */ 105 106 107 status = rtems_filesystem_evaluate_path(pathname, eval_flags, &temp_loc, TRUE );105 106 status = rtems_filesystem_evaluate_path( 107 pathname, eval_flags, &temp_loc, TRUE ); 108 108 109 109 if ( status == -1 ) { -
c/src/libfs/src/imfs/imfs_eval.c
re824fa5 r2f87c843 71 71 int flags_to_test; 72 72 73 if ( !rtems_libio_is_valid_perms( flags ) ) {73 if ( !rtems_libio_is_valid_perms( flags ) ) { 74 74 assert( 0 ); 75 75 set_errno_and_return_minus_one( EIO ); … … 142 142 */ 143 143 144 if ( !IMFS_evaluate_permission( node, flags ) )144 if ( !IMFS_evaluate_permission( node, flags ) ) 145 145 set_errno_and_return_minus_one( EACCES ); 146 146 … … 204 204 */ 205 205 206 if ( !IMFS_evaluate_permission( node, flags ) )206 if ( !IMFS_evaluate_permission( node, flags ) ) 207 207 set_errno_and_return_minus_one( EACCES ); 208 208 … … 308 308 if ( type != IMFS_NO_MORE_PATH ) 309 309 if ( node->type == IMFS_DIRECTORY ) 310 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )310 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 311 311 set_errno_and_return_minus_one( EACCES ); 312 312 … … 423 423 424 424 for( ; path[i] != '\0'; i++) { 425 if ( !IMFS_is_separator( path[ i ] ) )425 if ( !IMFS_is_separator( path[ i ] ) ) 426 426 set_errno_and_return_minus_one( ENOENT ); 427 427 } … … 444 444 */ 445 445 446 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) )446 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 447 447 set_errno_and_return_minus_one( EACCES ); 448 448 … … 473 473 int result; 474 474 475 if ( !rtems_libio_is_valid_perms( flags ) ) {475 if ( !rtems_libio_is_valid_perms( flags ) ) { 476 476 assert( 0 ); 477 477 set_errno_and_return_minus_one( EIO ); … … 502 502 if ( type != IMFS_NO_MORE_PATH ) 503 503 if ( node->type == IMFS_DIRECTORY ) 504 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )504 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 505 505 set_errno_and_return_minus_one( EACCES ); 506 506 … … 623 623 */ 624 624 625 if ( !IMFS_evaluate_permission( pathloc, flags ) )625 if ( !IMFS_evaluate_permission( pathloc, flags ) ) 626 626 set_errno_and_return_minus_one( EACCES ); 627 627 -
cpukit/libcsupport/src/mount.c
re824fa5 r2f87c843 102 102 103 103 /* 104 * Are the file system options valid? 105 */ 106 107 options = get_file_system_options( fsoptions ); 108 if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ){ 104 * Is there a file system operations table? 105 */ 106 107 if ( fs_ops == NULL ) { 109 108 errno = EINVAL; 110 109 return -1; … … 112 111 113 112 /* 114 * Is the file system typevalid?115 */ 116 117 if ( fs _ops == NULL ){113 * Are the file system options valid? 114 */ 115 116 if ( fsoptions == NULL ) { 118 117 errno = EINVAL; 119 118 return -1; 120 119 } 121 120 121 options = get_file_system_options( fsoptions ); 122 if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ) { 123 errno = EINVAL; 124 return -1; 125 } 126 122 127 /* 123 128 * Allocate a mount table entry … … 125 130 126 131 temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) ); 132 133 if ( !temp_mt_entry ) { 134 errno = ENOMEM; 135 return -1; 136 } 127 137 128 138 temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry; 129 139 temp_mt_entry->options = options; 130 if ( device )131 140 if ( device ) 141 sprintf( temp_mt_entry->dev, "%s", device ); 132 142 else 133 143 temp_mt_entry->dev = 0; 134 144 135 145 /* … … 150 160 */ 151 161 152 if ( temp_loc.ops->node_type( &temp_loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {162 if ( temp_loc.ops->node_type( &temp_loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 153 163 errno = ENOTDIR; 154 164 goto cleanup_and_bail; … … 159 169 */ 160 170 161 if ( search_mt_for_mount_point( &temp_loc ) == FOUND ) {171 if ( search_mt_for_mount_point( &temp_loc ) == FOUND ) { 162 172 errno = EBUSY; 163 173 goto cleanup_and_bail; … … 180 190 181 191 if ( !temp_loc.ops->mount ){ 182 errno = ENOTSUP;183 goto cleanup_and_bail;192 errno = ENOTSUP; 193 goto cleanup_and_bail; 184 194 } 185 195 … … 283 293 ) 284 294 { 285 Chain_Node *the_node;295 Chain_Node *the_node; 286 296 rtems_filesystem_mount_table_entry_t *the_mount_entry; 287 297 -
cpukit/libcsupport/src/open.c
re824fa5 r2f87c843 103 103 * See if the file exists. 104 104 */ 105 106 107 status = rtems_filesystem_evaluate_path(pathname, eval_flags, &temp_loc, TRUE );105 106 status = rtems_filesystem_evaluate_path( 107 pathname, eval_flags, &temp_loc, TRUE ); 108 108 109 109 if ( status == -1 ) { -
cpukit/libfs/src/imfs/imfs_eval.c
re824fa5 r2f87c843 71 71 int flags_to_test; 72 72 73 if ( !rtems_libio_is_valid_perms( flags ) ) {73 if ( !rtems_libio_is_valid_perms( flags ) ) { 74 74 assert( 0 ); 75 75 set_errno_and_return_minus_one( EIO ); … … 142 142 */ 143 143 144 if ( !IMFS_evaluate_permission( node, flags ) )144 if ( !IMFS_evaluate_permission( node, flags ) ) 145 145 set_errno_and_return_minus_one( EACCES ); 146 146 … … 204 204 */ 205 205 206 if ( !IMFS_evaluate_permission( node, flags ) )206 if ( !IMFS_evaluate_permission( node, flags ) ) 207 207 set_errno_and_return_minus_one( EACCES ); 208 208 … … 308 308 if ( type != IMFS_NO_MORE_PATH ) 309 309 if ( node->type == IMFS_DIRECTORY ) 310 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )310 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 311 311 set_errno_and_return_minus_one( EACCES ); 312 312 … … 423 423 424 424 for( ; path[i] != '\0'; i++) { 425 if ( !IMFS_is_separator( path[ i ] ) )425 if ( !IMFS_is_separator( path[ i ] ) ) 426 426 set_errno_and_return_minus_one( ENOENT ); 427 427 } … … 444 444 */ 445 445 446 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) )446 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) 447 447 set_errno_and_return_minus_one( EACCES ); 448 448 … … 473 473 int result; 474 474 475 if ( !rtems_libio_is_valid_perms( flags ) ) {475 if ( !rtems_libio_is_valid_perms( flags ) ) { 476 476 assert( 0 ); 477 477 set_errno_and_return_minus_one( EIO ); … … 502 502 if ( type != IMFS_NO_MORE_PATH ) 503 503 if ( node->type == IMFS_DIRECTORY ) 504 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )504 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) 505 505 set_errno_and_return_minus_one( EACCES ); 506 506 … … 623 623 */ 624 624 625 if ( !IMFS_evaluate_permission( pathloc, flags ) )625 if ( !IMFS_evaluate_permission( pathloc, flags ) ) 626 626 set_errno_and_return_minus_one( EACCES ); 627 627
Note: See TracChangeset
for help on using the changeset viewer.