removed redundant setting of async->buf_read_count since it is handled by
authorFrank Mori Hess <fmhess@speakeasy.net>
Sat, 22 Feb 2003 03:00:26 +0000 (03:00 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sat, 22 Feb 2003 03:00:26 +0000 (03:00 +0000)
comedi_read_free() call I added

comedi/kcomedilib/get.c

index 0efa7f60a2282da890143503caf8ebdae3bb165a..e38a6983c80ddf848926b5be73f943f718d7bc7a 100644 (file)
@@ -182,21 +182,21 @@ unsigned int comedi_get_buf_head_pos(comedi_t *d,unsigned int subdevice)
 }
 
 /*
- * ALPHA (not necessary)
+ * ALPHA
 */
 int comedi_set_user_int_count(comedi_t *d,unsigned int subdevice,unsigned int buf_user_count)
 {
        comedi_device *dev = (comedi_device *)d;
        comedi_subdevice *s = dev->subdevices + subdevice;
        comedi_async *async;
-       unsigned int num_bytes;
+       int num_bytes;
 
        async = s->async;
        if( async == NULL ) return -1;
 
        num_bytes =  buf_user_count - async->buf_read_count;
+       if( num_bytes < 0 ) return -1;
        comedi_buf_read_free( async, num_bytes );
-       async->buf_read_count = buf_user_count;
 
        return 0;
 }