summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/fcntl.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-08-11 20:04:27 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-08-11 20:04:27 +0000
commitdd19c0bb061af5595a970ed3c4f4af3824b65593 (patch)
treef946b796fc8e82900702a771e6f6c6b39cbe2297 /c/src/lib/libc/fcntl.c
parent2000-08-11 Charles-Antoine Gauthier <charles.gauthier@nrc.ca> (diff)
downloadrtems-dd19c0bb061af5595a970ed3c4f4af3824b65593.tar.bz2
2000-08-11 Chris Johns <ccj@acm.org>
* libc/chmod.c: Return ENOTSUP if filesystem does not have handler. * libc/eval.c: Ditto. * libc/fcntl.c: Ditto. * libc/fsync.c: Ditto. * libc/ioctl.c: Ditto. * libc/ioman.c: Ditto. * libc/link.c: Ditto. * libc/memfile.c: Ditto. * libc/mknod.c: Ditto. * libc/symlink.c: Ditto. * libc/libio.h(rtems_filesystem_dev_major_t): New macro. * libc/libio.h(rtems_filesystem_dev_minor_t): New macro.
Diffstat (limited to 'c/src/lib/libc/fcntl.c')
-rw-r--r--c/src/lib/libc/fcntl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/c/src/lib/libc/fcntl.c b/c/src/lib/libc/fcntl.c
index 05410eaff6..587726f885 100644
--- a/c/src/lib/libc/fcntl.c
+++ b/c/src/lib/libc/fcntl.c
@@ -131,10 +131,16 @@ int fcntl(
ret = -1;
break;
}
- if ((ret >= 0) && iop->handlers->fcntl) {
- int err = (*iop->handlers->fcntl)( cmd, iop );
- if (err) {
- errno = err;
+ if (ret >= 0) {
+ if (iop->handlers->fcntl) {
+ int err = (*iop->handlers->fcntl)( cmd, iop );
+ if (err) {
+ errno = err;
+ ret = -1;
+ }
+ }
+ else {
+ errno = ENOTSUP;
ret = -1;
}
}