[rtems commit] Filesystem: Change type of ioctl_return

Sebastian Huber sebh at rtems.org
Tue Apr 3 13:01:50 UTC 2012


Module:    rtems
Branch:    master
Commit:    5b045eb6f8b73ad224f6ee7e54eab28cd5771656
Changeset: http://git.rtems.org/rtems/commit/?id=5b045eb6f8b73ad224f6ee7e54eab28cd5771656

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Apr  3 14:50:44 2012 +0200

Filesystem: Change type of ioctl_return

Change the ioctl_return type of rtems_libio_ioctl_args_t to match the
ioctl() return value type.

---

 cpukit/libblock/src/blkdev.c             |    4 ++--
 cpukit/libcsupport/include/rtems/libio.h |    2 +-
 cpukit/libcsupport/src/termios.c         |    4 +---
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/cpukit/libblock/src/blkdev.c b/cpukit/libblock/src/blkdev.c
index 83ea563..29ea399 100644
--- a/cpukit/libblock/src/blkdev.c
+++ b/cpukit/libblock/src/blkdev.c
@@ -183,7 +183,7 @@ rtems_blkdev_generic_ioctl(
 
     if (args->command != RTEMS_BLKIO_REQUEST)
     {
-        args->ioctl_return = (uint32_t) dd->ioctl(dd,
+        args->ioctl_return = dd->ioctl(dd,
                                                   args->command,
                                                   args->buffer);
     }
@@ -193,7 +193,7 @@ rtems_blkdev_generic_ioctl(
          * It is not allowed to directly access the driver circumventing the
          * cache.
          */
-        args->ioctl_return = (uint32_t) -1;
+        args->ioctl_return = -1;
     }
 
     return RTEMS_SUCCESSFUL;
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index 968681b..f1908f7 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -1201,7 +1201,7 @@ typedef struct {
   rtems_libio_t          *iop;
   uint32_t                command;
   void                   *buffer;
-  uint32_t                ioctl_return;
+  int                     ioctl_return;
 } rtems_libio_ioctl_args_t;
 
 /**
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c
index fc74718..17fa5ef 100644
--- a/cpukit/libcsupport/src/termios.c
+++ b/cpukit/libcsupport/src/termios.c
@@ -517,10 +517,9 @@ rtems_termios_ioctl (void *arg)
   struct ttywakeup         *wakeup = (struct ttywakeup *)args->buffer;
   rtems_status_code sc;
 
-   args->ioctl_return = 0;
+  args->ioctl_return = 0;
   sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
   if (sc != RTEMS_SUCCESSFUL) {
-    args->ioctl_return = sc;
     return sc;
   }
   switch (args->command) {
@@ -619,7 +618,6 @@ rtems_termios_ioctl (void *arg)
   }
 
   rtems_semaphore_release (tty->osem);
-  args->ioctl_return = sc;
   return sc;
 }
 




More information about the vc mailing list