comedi_test: fix test_cmd_write_fast_1chan() for big buffer
If the comedi data buffer is larger than the total size of the data being written to the buffer in first test_cmd_write_fast_1chan(), the first loop iterates endlessly writing 0 bytes to the buffer. Break out of the first loop once the required amount of data has been written.
This commit is contained in:
parent
207c72b0f9
commit
9683559f51
1 changed files with 3 additions and 1 deletions
|
@ -211,8 +211,10 @@ int test_cmd_write_fast_1chan(void)
|
||||||
if(ret<wc){
|
if(ret<wc){
|
||||||
go = 0;
|
go = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
total += ret;
|
total += ret;
|
||||||
|
if(total >= num_bytes){
|
||||||
|
go = 0;
|
||||||
|
}
|
||||||
if(verbose)printf("write %d %d\n",ret,total);
|
if(verbose)printf("write %d %d\n",ret,total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue