tboox / tbox

🎁 A glib-like multi-platform c library
https://docs.tboox.org
Apache License 2.0
4.89k stars 725 forks source link

bugfix: fwatcher: fix recursion detect issue for linux platform #266

Closed Sunrisepeak closed 2 months ago

Sunrisepeak commented 2 months ago

use -1 to set recursion limit(align to bsd-impl)

Sunrisepeak commented 2 months ago

同时也修了一下 bsd, 应为当 recursion = false, walk 0 的时候 对应的就是未修改的linux下recursion 为true的实现 实际会监听两层

watching watch_test/** ..
watch_test/test.txt modified
watch_test/test.txt modified
watch_test/test.txt modified
watch_test/test.txt modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified
Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


At the same time, I also revised the bsd. It should be that when recursion = false, walk 0, it corresponds to the unmodified implementation of recursion as true under Linux. It will actually monitor two layers.

watching watch_test/** ..
watch_test/test.txt modified
watch_test/test.txt modified
watch_test/test.txt modified
watch_test/test.txt modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified
watch_test/dir1/t.text modified