diff options
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/include/rtems/libio_.h | 5 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio_.h | 5 | ||||
-rw-r--r-- | cpukit/libcsupport/src/libio.c | 18 |
3 files changed, 20 insertions, 8 deletions
diff --git a/cpukit/include/rtems/libio_.h b/cpukit/include/rtems/libio_.h index 7e0f6df71e..6a4943be75 100644 --- a/cpukit/include/rtems/libio_.h +++ b/cpukit/include/rtems/libio_.h @@ -165,8 +165,9 @@ extern rtems_libio_t *rtems_libio_iop_freelist; #define rtems_filesystem_freenode( _node ) \ do { \ - if ( (_node)->ops->freenod_h ) \ - (*(_node)->ops->freenod_h)( (_node) ); \ + if ( (_node)->ops )\ + if ( (_node)->ops->freenod_h ) \ + (*(_node)->ops->freenod_h)( (_node) ); \ } while (0) /* diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index 7e0f6df71e..6a4943be75 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -165,8 +165,9 @@ extern rtems_libio_t *rtems_libio_iop_freelist; #define rtems_filesystem_freenode( _node ) \ do { \ - if ( (_node)->ops->freenod_h ) \ - (*(_node)->ops->freenod_h)( (_node) ); \ + if ( (_node)->ops )\ + if ( (_node)->ops->freenod_h ) \ + (*(_node)->ops->freenod_h)( (_node) ); \ } while (0) /* diff --git a/cpukit/libcsupport/src/libio.c b/cpukit/libcsupport/src/libio.c index 1216ec15a5..f5cd36dbd9 100644 --- a/cpukit/libcsupport/src/libio.c +++ b/cpukit/libcsupport/src/libio.c @@ -206,10 +206,20 @@ rtems_libio_t *rtems_libio_allocate( void ) if (rc != RTEMS_SUCCESSFUL) goto failed; rtems_libio_iop_freelist = iop->data1; - iop->data1 = 0; - iop->flags = LIBIO_FLAGS_OPEN; - iop->size = 0; - iop->offset = 0; + + iop->driver = NULL; + iop->size = 0; + iop->offset = 0; + iop->flags = LIBIO_FLAGS_OPEN; + iop->pathinfo.node_access = NULL; + iop->pathinfo.handlers = NULL; + iop->pathinfo.ops = NULL; + iop->pathinfo.mt_entry = NULL; + iop->data0 = 0; + iop->data1 = NULL; + iop->file_info = NULL; + iop->handlers = NULL; + goto done; } |