summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/fcntl.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/fcntl.c')
-rw-r--r--cpukit/libcsupport/src/fcntl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/cpukit/libcsupport/src/fcntl.c b/cpukit/libcsupport/src/fcntl.c
index 05410eaff6..587726f885 100644
--- a/cpukit/libcsupport/src/fcntl.c
+++ b/cpukit/libcsupport/src/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;
}
}