From 204a0ded8d620d5f912959f9ecd74f50a0a0999b Mon Sep 17 00:00:00 2001 From: Vlad Starodubtsev Date: Tue, 2 Apr 2019 19:57:53 +0300 Subject: [PATCH] monitor: fix setting max_user_watches. reset file position after read. --- monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 7652fd6..9e56bc7 100644 --- a/monitor.c +++ b/monitor.c @@ -105,8 +105,9 @@ raise_watch_limit(unsigned int limit) return; if (!limit) { - if (fscanf(max_watches, "%u", &limit) < 1) + if (fscanf(max_watches, "%10u", &limit) < 1) limit = 8192; + rewind(max_watches); } fprintf(max_watches, "%u", next_highest(limit)); fclose(max_watches);