Normalize symlinks in fsnotifier

This commit is contained in:
Roman Shevchenko
2010-06-01 19:42:14 +04:00
parent 72522ed6cd
commit da8c752870
4 changed files with 6 additions and 1 deletions
Binary file not shown.
Binary file not shown.
+3 -1
View File
@@ -284,7 +284,9 @@ static int walk_tree(const char* path, watch_node* parent, array* ignores) {
int watch(const char* root, array* ignores) {
return walk_tree(root, NULL, ignores);
char buf[PATH_MAX];
const char* normalized = realpath(root, buf);
return walk_tree((normalized != NULL ? normalized : root), NULL, ignores);
}
+3
View File
@@ -1,2 +1,5 @@
#!/bin/sh
echo "compiling 32-bit version"
gcc -O2 -m32 -Wall -std=c99 -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -o fsnotifier main.c inotify.c util.c
echo "compiling 64-bit version"
gcc -O2 -m64 -Wall -std=c99 -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -o fsnotifier64 main.c inotify.c util.c