Module: xenomai-abe
Branch: analogy
Commit: de2005541a6eb13888a355cfe20f9c423cabb7bd
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=de2005541a6eb13888a355cfe20f9c423cabb7bd

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Tue Mar 16 01:19:23 2010 +0100

analogy: change the error code in case of context error (-EPERM -> -ENOSYS)

Replace the -EPERM code by the -ENOSYS in bufconfig and mmap
ioctls. These two ioctls must be performed in NRT context. With the
__xn_exec_adaptive flag, the syscalls may be restarted in the proper
domain (NRT in our case) if the suitable error code is sent.

---

 ksrc/drivers/analogy/buffer.c |    7 ++-----
 ksrc/drivers/analogy/device.c |    2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c
index 0c66b4a..aa6acac 100644
--- a/ksrc/drivers/analogy/buffer.c
+++ b/ksrc/drivers/analogy/buffer.c
@@ -397,8 +397,7 @@ int a4l_ioctl_mmap(a4l_cxt_t *cxt, void *arg)
        /* The mmap operation cannot be performed in a 
           real-time context */
        if (a4l_test_rt() != 0) {
-               __a4l_err("a4l_ioctl_mmap: mmap must be done in NRT context\n");
-               return -EPERM;
+               return -ENOSYS;
        }
 
        /* Recover the argument structure */
@@ -473,9 +472,7 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg)
        /* As Linux API is used to allocate a virtual buffer,
           the calling process must not be in primary mode */
        if (a4l_test_rt() != 0) {
-               __a4l_err("a4l_ioctl_bufcfg: buffer config must done "
-                         "in NRT context\n");
-               return -EPERM;
+               return -ENOSYS;
        }
 
        if (rtdm_safe_copy_from_user(cxt->user_info,
diff --git a/ksrc/drivers/analogy/device.c b/ksrc/drivers/analogy/device.c
index 082053f..ec40b95 100644
--- a/ksrc/drivers/analogy/device.c
+++ b/ksrc/drivers/analogy/device.c
@@ -428,7 +428,7 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg)
                  "a4l_ioctl_devcfg: minor=%d\n", a4l_get_minor(cxt));
 
        if (a4l_test_rt() != 0)
-               return -EPERM;
+               return -ENOSYS;
 
        if (arg == NULL) {
                /* Basic checking */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to