From d81a2b0f542cd2854630e2bfa7771471f7070903 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 1 Sep 2003 04:02:14 +0000 Subject: [PATCH] on second thought, EPERM isn't any more accurate than ENODEV. --- comedi/comedi_fops.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 47fdcf82..b125c89a 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -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; -- 2.26.2