Index: c/src/exec/include/rtems/libio_.h
===================================================================
--- c/src/exec/include/rtems/libio_.h	(revision bc85fdbba3d13bfe1474a35298c6eeb48f562301)
+++ c/src/exec/include/rtems/libio_.h	(revision 1af79634798aca7004564d68bd47d3810a40370b)
@@ -166,6 +166,7 @@
 #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)
 
Index: c/src/exec/libcsupport/include/rtems/libio_.h
===================================================================
--- c/src/exec/libcsupport/include/rtems/libio_.h	(revision bc85fdbba3d13bfe1474a35298c6eeb48f562301)
+++ c/src/exec/libcsupport/include/rtems/libio_.h	(revision 1af79634798aca7004564d68bd47d3810a40370b)
@@ -166,6 +166,7 @@
 #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)
 
Index: c/src/exec/libcsupport/src/libio.c
===================================================================
--- c/src/exec/libcsupport/src/libio.c	(revision bc85fdbba3d13bfe1474a35298c6eeb48f562301)
+++ c/src/exec/libcsupport/src/libio.c	(revision 1af79634798aca7004564d68bd47d3810a40370b)
@@ -207,8 +207,18 @@
       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;
   }
Index: c/src/lib/ChangeLog
===================================================================
--- c/src/lib/ChangeLog	(revision bc85fdbba3d13bfe1474a35298c6eeb48f562301)
+++ c/src/lib/ChangeLog	(revision 1af79634798aca7004564d68bd47d3810a40370b)
@@ -1,2 +1,9 @@
+2001-10-25	Jennifer Averett <jennifer@OARcorp.com>
+
+	* libc/libio.c: Initialize more fields to NULL/0 during initialiation.
+	* include/rtems/libio_.h: Fix freenode macro so it works for sockets
+	which do not have the full set of filesystem operations and are 
+	initialized via something other than open().
+
 2001-10-18	Till Straumann <strauman@SLAC.Stanford.EDU>
 
Index: c/src/lib/include/rtems/libio_.h
===================================================================
--- c/src/lib/include/rtems/libio_.h	(revision bc85fdbba3d13bfe1474a35298c6eeb48f562301)
+++ c/src/lib/include/rtems/libio_.h	(revision 1af79634798aca7004564d68bd47d3810a40370b)
@@ -166,6 +166,7 @@
 #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)
 
Index: c/src/lib/libc/libio.c
===================================================================
--- c/src/lib/libc/libio.c	(revision bc85fdbba3d13bfe1474a35298c6eeb48f562301)
+++ c/src/lib/libc/libio.c	(revision 1af79634798aca7004564d68bd47d3810a40370b)
@@ -207,8 +207,18 @@
       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;
   }
Index: cpukit/include/rtems/libio_.h
===================================================================
--- cpukit/include/rtems/libio_.h	(revision bc85fdbba3d13bfe1474a35298c6eeb48f562301)
+++ cpukit/include/rtems/libio_.h	(revision 1af79634798aca7004564d68bd47d3810a40370b)
@@ -166,6 +166,7 @@
 #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)
 
Index: cpukit/libcsupport/include/rtems/libio_.h
===================================================================
--- cpukit/libcsupport/include/rtems/libio_.h	(revision bc85fdbba3d13bfe1474a35298c6eeb48f562301)
+++ cpukit/libcsupport/include/rtems/libio_.h	(revision 1af79634798aca7004564d68bd47d3810a40370b)
@@ -166,6 +166,7 @@
 #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)
 
Index: cpukit/libcsupport/src/libio.c
===================================================================
--- cpukit/libcsupport/src/libio.c	(revision bc85fdbba3d13bfe1474a35298c6eeb48f562301)
+++ cpukit/libcsupport/src/libio.c	(revision 1af79634798aca7004564d68bd47d3810a40370b)
@@ -207,8 +207,18 @@
       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;
   }
