summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2018-09-29 10:19:32 +0200
committernicolargo <nicolas@nicolargo.com>2018-09-29 10:32:17 +0200
commit6b0564045261d55a2fa5865b55f9918d09304206 (patch)
tree31c5d7252aa4dc6b02f8abdbfe1234d2f8e5035f
parent9b29f15130319f59421c4e4c7df668873105b0b1 (diff)
Glances IO Errorno 22 - Invalid argument #1326
-rw-r--r--NEWS7
-rw-r--r--glances/standalone.py9
2 files changed, 13 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 36935cb8..73f982df 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,13 @@
Glances Version 3
==============================================================================
+Version 3.0.2
+=============
+
+Bug corrected:
+
+ * Glances IO Errorno 22 - Invalid argument #1326
+
Version 3.0.1
=============
diff --git a/glances/standalone.py b/glances/standalone.py
index 8399c6fd..7feab300 100644
--- a/glances/standalone.py
+++ b/glances/standalone.py
@@ -119,17 +119,20 @@ class GlancesStandalone(object):
self.stats.export(self.stats)
logger.debug('Stats exported in {} seconds'.format(counter_export.get()))
+ # Patch for issue1326 to avoid < 0 refresh
+ adapted_refresh = self.refresh_time - counter.get()
+ adapted_refresh = adapted_refresh if adapted_refresh > 0 else 0
+
# Display stats
# and wait refresh_time - counter
if not self.quiet:
# The update function return True if an exit key 'q' or 'ESC'
# has been pressed.
- ret = not self.screen.update(self.stats,
- duration=self.refresh_time - counter.get())
+ ret = not self.screen.update(self.stats, duration=adapted_refresh)
else:
# Nothing is displayed
# Break should be done via a signal (CTRL-C)
- time.sleep(self.refresh_time - counter.get())
+ time.sleep(adapted_refresh)
ret = True
return ret