Archived
1
0
Fork 0

some cleanup and extended insertion in rbtree, updated rbtree test

This commit is contained in:
Henrik Hautakoski 2010-04-28 08:49:15 +02:00 committed by Henrik Hautakoski
parent 401b11fdcf
commit f630cbf979
8 changed files with 382 additions and 310 deletions

View file

@ -109,24 +109,19 @@ static int proc_event(inoev *iev) {
if (iev == NULL)
return 0;
//notify_event_clear(&event);
/* notify_event_clear(&event); */
#ifdef __DEBUG__
fprintf(stderr, "RAW EVENT: %i, %x", iev->wd, iev->mask);
if (iev->len)
fprintf(stderr, ", %s\n", iev->name);
else
fprintf(stderr, "\n");
#endif
/* lookup the watch descriptor in rbtree */
node = rbtree_search(&tree, iev->wd);
if (node == NULL) {
#ifdef __DEBUG__
fprintf(stderr, "-- IGNORING EVENT -- invalid watchdescriptor %i\n", iev->wd);
rb_assert(tree.root);
#endif
dprint("-- IGNORING EVENT -- invalid watchdescriptor %i\n", iev->wd);
return 0;
}
@ -152,10 +147,10 @@ static int proc_event(inoev *iev) {
case IN_MOVED_TO :
if (event.dir) {
dprint("IN_CREATE on directory, adding\n");
dprint("IN_MOVED_TO on directory, adding\n");
addwatch(event.path, event.filename);
}
type = NOTIFY_MOVE_TO;
break;
case IN_MOVED_FROM :