diff options
Diffstat (limited to 'pcitool')
-rw-r--r-- | pcitool/cli.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pcitool/cli.c b/pcitool/cli.c index 60beb3c..79ec9ce 100644 --- a/pcitool/cli.c +++ b/pcitool/cli.c @@ -1285,8 +1285,10 @@ int GrabCallback(pcilib_event_id_t event_id, pcilib_event_info_t *info, void *us ctx->event_pending = 0; ctx->event_count++; - - ctx->missing_count += (info->seqnum - ctx->last_num) - 1; + + if (ctx->last_num) + ctx->missing_count += (info->seqnum - ctx->last_num) - 1; + ctx->last_num = info->seqnum; if (info->flags&PCILIB_EVENT_INFO_FLAG_BROKEN) { @@ -1361,7 +1363,8 @@ int raw_data(pcilib_event_id_t event_id, pcilib_event_info_t *info, pcilib_event } ctx->event_count++; - ctx->missing_count += (info->seqnum - ctx->last_num) - 1; + if (ctx->last_num) + ctx->missing_count += (info->seqnum - ctx->last_num) - 1; ctx->last_num = info->seqnum; } |