summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-08-16 22:22:16 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-08-16 22:22:16 +0000
commit45e1417c518eba79654263cea63ed0eba0324f91 (patch)
treecbf23a8b5c28f4591e11ff7937a1d2fc4c94731d
parent2001-08-16 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-45e1417c518eba79654263cea63ed0eba0324f91.tar.bz2
2001-08-16 Joel Sherrill <joel@OARcorp.com>
* src/mqueuesendsupp.c: Account for possibly blocking during the core send operation. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * src/msgqsubmit.c: Add a comment indicating that we do not have to account for possibly blocking during the core send operation because Classic API message queue send is always non-blocking. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * include/rtems/score/coremsg.h, src/coremsgsubmit.c: Add a new return status to account for blocking sends. Otherwise, the caller will think that the returned message status will have the ultimate results of the operation. If the send times out, the final status will be in the return_code of the thread. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * src/coremutexsurrender.c: Use holder thread not executing thread because even though they may and often are the same it is not guaranteed unless the proper attribute is set. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * startup/linkcmds: Modified to work better with gcc 2.8.1 and gnat 3.13p. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * tools/runtest.in: Recognize debug variant of monitor test. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * sp13/sp13.scn: Id in screen had wrong class field value. * sp13/system.h: Account for message buffer memory. * sp13/task2.c: Remove unnecessary check for failure. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * sp20/system.h: Account for extra task stacks properly. 2001-08-16 Joel Sherrill <joel@OARcorp.com> * include/tmacros.h: Attempt to print errno as further information.
-rw-r--r--c/src/lib/libc/libio_sockets.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/c/src/lib/libc/libio_sockets.c b/c/src/lib/libc/libio_sockets.c
index ac15a2a5c2..e9e7f3e952 100644
--- a/c/src/lib/libc/libio_sockets.c
+++ b/c/src/lib/libc/libio_sockets.c
@@ -32,6 +32,13 @@ struct socket *rtems_bsdnet_fdToSocket(
return NULL;
}
iop = &rtems_libio_iops[fd];
+
+ /* same as rtems_libio_check_is_open(iop) but different return */
+ if ((iop->flags & LIBIO_FLAGS_OPEN) == 0) {
+ errno = EBADF;
+ return NULL;
+ }
+
if (iop->data1 == NULL)
errno = EBADF;
return iop->data1;