summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli.c4
-rw-r--r--tools.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/cli.c b/cli.c
index 5fc3162..d7f36d0 100644
--- a/cli.c
+++ b/cli.c
@@ -2488,6 +2488,10 @@ int main(int argc, char **argv) {
if (run_time) timeout = PCILIB_TIMEOUT_INFINITE;
else timeout = PCILIB_EVENT_TIMEOUT;
}
+
+ if (!size_set) {
+ if (run_time) size = 0;
+ }
}
if (mode != MODE_GRAB) {
diff --git a/tools.c b/tools.c
index 4105597..e0789fb 100644
--- a/tools.c
+++ b/tools.c
@@ -347,7 +347,7 @@ pcilib_timeout_t pcilib_timediff(struct timeval *tvs, struct timeval *tve) {
int pcilib_timecmp(struct timeval *tv1, struct timeval *tv2) {
if (tv1->tv_sec > tv2->tv_sec) return 1;
- else if (tv1->tv_sec > tv2->tv_sec) return -1;
+ else if (tv1->tv_sec < tv2->tv_sec) return -1;
else if (tv1->tv_usec > tv2->tv_usec) return 1;
else if (tv1->tv_usec < tv2->tv_usec) return -1;
return 0;