Corrected spacing and added some new error checks that were needed

to avoid dereferencing NULLs.
This commit is contained in:
Joel Sherrill
1999-02-05 00:28:43 +00:00
parent e824fa5073
commit 2f87c84349
10 changed files with 111 additions and 81 deletions

View File

@@ -101,20 +101,25 @@ int mount(
/* XXX add code to check for required operations */
/*
* Are the file system options valid?
* Is there a file system operations table?
*/
options = get_file_system_options( fsoptions );
if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ){
if ( fs_ops == NULL ) {
errno = EINVAL;
return -1;
}
/*
* Is the file system type valid?
* Are the file system options valid?
*/
if ( fs_ops == NULL ){
if ( fsoptions == NULL ) {
errno = EINVAL;
return -1;
}
options = get_file_system_options( fsoptions );
if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ) {
errno = EINVAL;
return -1;
}
@@ -125,6 +130,11 @@ int mount(
temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) );
if ( !temp_mt_entry ) {
errno = ENOMEM;
return -1;
}
temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry;
temp_mt_entry->options = options;
if ( device )

View File

@@ -103,8 +103,8 @@ int open(
* See if the file exists.
*/
status = rtems_filesystem_evaluate_path( pathname, eval_flags, &temp_loc, TRUE );
status = rtems_filesystem_evaluate_path(
pathname, eval_flags, &temp_loc, TRUE );
if ( status == -1 ) {
if ( errno != ENOENT ) {

View File

@@ -101,20 +101,25 @@ int mount(
/* XXX add code to check for required operations */
/*
* Are the file system options valid?
* Is there a file system operations table?
*/
options = get_file_system_options( fsoptions );
if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ){
if ( fs_ops == NULL ) {
errno = EINVAL;
return -1;
}
/*
* Is the file system type valid?
* Are the file system options valid?
*/
if ( fs_ops == NULL ){
if ( fsoptions == NULL ) {
errno = EINVAL;
return -1;
}
options = get_file_system_options( fsoptions );
if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ) {
errno = EINVAL;
return -1;
}
@@ -125,6 +130,11 @@ int mount(
temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) );
if ( !temp_mt_entry ) {
errno = ENOMEM;
return -1;
}
temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry;
temp_mt_entry->options = options;
if ( device )

View File

@@ -103,8 +103,8 @@ int open(
* See if the file exists.
*/
status = rtems_filesystem_evaluate_path( pathname, eval_flags, &temp_loc, TRUE );
status = rtems_filesystem_evaluate_path(
pathname, eval_flags, &temp_loc, TRUE );
if ( status == -1 ) {
if ( errno != ENOENT ) {

View File

@@ -101,20 +101,25 @@ int mount(
/* XXX add code to check for required operations */
/*
* Are the file system options valid?
* Is there a file system operations table?
*/
options = get_file_system_options( fsoptions );
if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ){
if ( fs_ops == NULL ) {
errno = EINVAL;
return -1;
}
/*
* Is the file system type valid?
* Are the file system options valid?
*/
if ( fs_ops == NULL ){
if ( fsoptions == NULL ) {
errno = EINVAL;
return -1;
}
options = get_file_system_options( fsoptions );
if ( options == RTEMS_FILESYSTEM_BAD_OPTIONS ) {
errno = EINVAL;
return -1;
}
@@ -125,6 +130,11 @@ int mount(
temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) );
if ( !temp_mt_entry ) {
errno = ENOMEM;
return -1;
}
temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry;
temp_mt_entry->options = options;
if ( device )

View File

@@ -103,8 +103,8 @@ int open(
* See if the file exists.
*/
status = rtems_filesystem_evaluate_path( pathname, eval_flags, &temp_loc, TRUE );
status = rtems_filesystem_evaluate_path(
pathname, eval_flags, &temp_loc, TRUE );
if ( status == -1 ) {
if ( errno != ENOENT ) {