[haiku-commits] r40787 - haiku/trunk/src/system/kernel/fs

Author: korli
Date: 2011-03-02 19:58:14 +0100 (Wed, 02 Mar 2011)
New Revision: 40787
Changeset: http://dev.haiku-os.org/changeset/40787
Ticket: http://dev.haiku-os.org/ticket/7279

Modified:
   haiku/trunk/src/system/kernel/fs/fd.cpp
   haiku/trunk/src/system/kernel/fs/vfs.cpp
Log:
* if ioctl hook wasn't found, now returns B_DEV_INVALID_IOCTL
* in case fd_ioctl() was about to return B_DEV_INVALID_IOCTL, translate to 
ENOTTY to satisfy #7279.


Modified: haiku/trunk/src/system/kernel/fs/fd.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/fd.cpp     2011-03-02 18:49:02 UTC (rev 
40786)
+++ haiku/trunk/src/system/kernel/fs/fd.cpp     2011-03-02 18:58:14 UTC (rev 
40787)
@@ -518,8 +518,11 @@
        if (descriptor->ops->fd_ioctl)
                status = descriptor->ops->fd_ioctl(descriptor, op, buffer, 
length);
        else
-               status = B_NOT_SUPPORTED;
+               status = B_DEV_INVALID_IOCTL;
 
+       if (status == B_DEV_INVALID_IOCTL)
+               status = ENOTTY;
+
        put_fd(descriptor);
        return status;
 }

Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/vfs.cpp    2011-03-02 18:49:02 UTC (rev 
40786)
+++ haiku/trunk/src/system/kernel/fs/vfs.cpp    2011-03-02 18:58:14 UTC (rev 
40787)
@@ -5858,7 +5858,7 @@
        if (HAS_FS_CALL(vnode, ioctl))
                return FS_CALL(vnode, ioctl, descriptor->cookie, op, buffer, 
length);
 
-       return B_NOT_SUPPORTED;
+       return B_DEV_INVALID_IOCTL;
 }
 
 


Other related posts: