on second thought, EPERM isn't any more accurate than ENODEV.
authorFrank Mori Hess <fmhess@speakeasy.net>
Mon, 1 Sep 2003 04:02:14 +0000 (04:02 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Mon, 1 Sep 2003 04:02:14 +0000 (04:02 +0000)
comedi/comedi_fops.c

index 47fdcf822dc689f41281de0325dc550ec098d39c..b125c89a4c499ef1b385bec050f4a71706ae3eae 100644 (file)
@@ -1631,9 +1631,10 @@ static int comedi_fop_open(struct inode *inode,struct file *file)
 
        dev->in_request_module=0;
 
-       if(!dev->attached && !capable(CAP_SYS_ADMIN))
-               return -EPERM;
-
+       if(!dev->attached && !capable(CAP_SYS_ADMIN)){
+               DPRINTK("not attached and not root\n");
+               return -ENODEV;
+       }
 ok:
        if(!try_module_get(THIS_MODULE))
                return -ENOSYS;