This way a user can specify a gap below 1ms. This is somehwat similar
to setting the gap to 0, but the ENOBUFS are greatly reduced, so a given
amount of CAN messages by -n is still usefull and useable.
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
int main(int argc, char **argv)
{
- unsigned long gap = DEFAULT_GAP;
+ double gap = DEFAULT_GAP;
unsigned long polltimeout = 0;
unsigned char ignore_enobufs = 0;
unsigned char extended = 0;
break;
case 'g':
- gap = strtoul(optarg, NULL, 10);
+ gap = strtod(optarg, NULL);
break;
case 'e':
}
ts.tv_sec = gap / 1000;
- ts.tv_nsec = (gap % 1000) * 1000000;
+ ts.tv_nsec = ((int)(gap * 1000000)) % 1000000000;
if (id_mode == MODE_FIX) {