From 45e1417c518eba79654263cea63ed0eba0324f91 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 16 Aug 2001 22:22:16 +0000 Subject: 2001-08-16 Joel Sherrill * src/mqueuesendsupp.c: Account for possibly blocking during the core send operation. 2001-08-16 Joel Sherrill * 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 * 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 * 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 * startup/linkcmds: Modified to work better with gcc 2.8.1 and gnat 3.13p. 2001-08-16 Joel Sherrill * tools/runtest.in: Recognize debug variant of monitor test. 2001-08-16 Joel Sherrill * 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 * sp20/system.h: Account for extra task stacks properly. 2001-08-16 Joel Sherrill * include/tmacros.h: Attempt to print errno as further information. --- c/src/lib/libc/libio_sockets.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- cgit v1.2.3