Skip to content

Commit

Permalink
fixed a bug in interval time updating
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuehrer committed Jul 6, 2021
1 parent 681b899 commit c306fea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dwmblocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void statusloop()
}
unsigned int i = 0;
int interrupted = 0;
struct timespec sleeptime = {interval, 0};
const struct timespec sleeptime = {interval, 0};
struct timespec tosleep = sleeptime;
getcmds(-1);
while(statusContinue)
Expand All @@ -234,7 +234,7 @@ void statusloop()
getcmds(i);
writestatus();
// then increment since its actually been a second (plus the time it took the commands to run)
i++;
i += interval;
// set the time to sleep back to the sleeptime of 1s
tosleep = sleeptime;
}
Expand Down

0 comments on commit c306fea

Please sign in to comment.