have comedi_command set subdevice->busy
authorFrank Mori Hess <fmhess@speakeasy.net>
Thu, 29 Apr 2004 22:13:21 +0000 (22:13 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Thu, 29 Apr 2004 22:13:21 +0000 (22:13 +0000)
comedi/kcomedilib/kcomedilib_main.c

index 01c19629d76ea3cb5073f99f956299eb7493872f..4c640bd9cc08f64b4d914f5a0757030d9e1ac148 100644 (file)
@@ -150,17 +150,17 @@ int comedi_command(comedi_t *d,comedi_cmd *cmd)
        if(async == NULL)
                return -ENODEV;
 
+       if(s->busy)
+               return -EBUSY;
+       s->busy = d;
+
        if(async->cb_mask & COMEDI_CB_EOS)
                cmd->flags |= TRIG_WAKE_EOS;
 
        async->cmd=*cmd;
 
-#if 0
-       s->runflags=0;
-#else
-       s->runflags=SRF_RT;
+       s->runflags |= SRF_RT;
        comedi_switch_to_rt(dev);
-#endif
 
        s->subdev_flags |= SDF_RUNNING;