diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-12 18:17:47 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-12 18:17:47 +0100 |
commit | 258fc6e84ec0d8b5597c1b0ba1f37d8b20a01297 (patch) | |
tree | 654afb5e042c14276a5c6052e0d167a7b624e591 | |
parent | 4be7a59b5a5253e90a299b56eb188c8b970c07b5 (diff) | |
download | pcitool-258fc6e84ec0d8b5597c1b0ba1f37d8b20a01297.tar.gz pcitool-258fc6e84ec0d8b5597c1b0ba1f37d8b20a01297.tar.bz2 pcitool-258fc6e84ec0d8b5597c1b0ba1f37d8b20a01297.tar.xz pcitool-258fc6e84ec0d8b5597c1b0ba1f37d8b20a01297.zip |
Fix errors preventing time-limited grabbing
-rw-r--r-- | cli.c | 4 | ||||
-rw-r--r-- | tools.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -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) { @@ -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; |