diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-12-14 11:42:14 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-12-14 11:42:14 +0100 |
commit | a03c7039eb703e86010c7c8bd2e462c01d4db7b7 (patch) | |
tree | 1645038bbf66896d5712e82368804e2983173ddc | |
parent | 5392fa72824601777f5038baf72a3f776f1d4376 (diff) |
sfeed_tail: wakeup less often by default
The files are now checked every 10 seconds instead of 1 second.
NOTE: ofcourse it still first checks the filesize and modification time and
only then proceeds.
-rw-r--r-- | sfeed_tail.1 | 4 | ||||
-rw-r--r-- | sfeed_tail.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sfeed_tail.1 b/sfeed_tail.1 index 9734339..955c423 100644 --- a/sfeed_tail.1 +++ b/sfeed_tail.1 @@ -1,4 +1,4 @@ -.Dd August 22, 2018 +.Dd December 14, 2018 .Dt SFEED_TAIL 1 .Os .Sh NAME @@ -28,7 +28,7 @@ will also only process and show items that are considered new: the item timestamp is not older than a day ago. .Sh IMPLEMENTATION NOTES .Nm -checks for file modifications each second by checking the filesize and +checks for file modifications every 10 seconds by checking the filesize and modification time. Keep in mind that because .Nm diff --git a/sfeed_tail.c b/sfeed_tail.c index cce8ea0..fd47a43 100644 --- a/sfeed_tail.c +++ b/sfeed_tail.c @@ -158,7 +158,7 @@ main(int argc, char *argv[]) continue; } - /* did the file change? by size, modification */ + /* did the file change? by size or modification time */ if (stfiles[i - 1].st_size != st.st_size || stfiles[i - 1].st_mtime != st.st_mtime) { name = ((name = strrchr(argv[i], '/'))) ? name + 1 : argv[i]; @@ -177,8 +177,8 @@ main(int argc, char *argv[]) changed = 0; slept = 0; } - sleep(1); - slept++; + sleep(10); + slept += 10; firsttime = 0; } return 0; |