Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Busy loop in pause mode #21

Closed
bernhardschmidt opened this issue Aug 5, 2013 · 1 comment
Closed

Busy loop in pause mode #21

bernhardschmidt opened this issue Aug 5, 2013 · 1 comment

Comments

@bernhardschmidt
Copy link

Reported at the Debian BTS by Moritz Hoffmann at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637546 . All credits to him. Verified in 0.85


mtr has an undocumented option in curses mode that pauses mtr. Simply
press 'p' and the process will stop until space is pressed. However, it
does not wait for input but rather calls select repeatedly to wait for
an event. Due to the select parameters, select returns immediately such
that mtr constantly loops.

The problem is in select.c. However, I don't know what the best patch
for this is. The following patch just increases the timeout so that the
mtr does not spin that fast.

--- mtr-0.80.orig/select.c
+++ mtr-0.80/select.c
@@ -84,8 +84,8 @@
     do {
       if(anyset || paused) {
        selecttime.tv_sec = 0;
-       selecttime.tv_usec = 0;
-
+       selecttime.tv_usec = 200;
+
        rv = select(maxfd, (void *)&readfd, NULL, NULL, &selecttime);

       } else {
@rewolff
Copy link
Collaborator

rewolff commented Jun 19, 2014

This bug has been fixed.

@rewolff rewolff closed this as completed Jun 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants