[gamin] forgot patch...
- From: John McCutchan <ttb tentacle dhs org>
- To: gamin-list gnome org
- Subject: [gamin] forgot patch...
- Date: Fri, 05 Aug 2005 14:11:15 -0400
Hey, it's friday right?
--
John McCutchan <ttb tentacle dhs org>
Index: server/gam_poll.c
===================================================================
RCS file: /cvs/gnome/gamin/server/gam_poll.c,v
retrieving revision 1.66
diff -u -r1.66 gam_poll.c
--- server/gam_poll.c 4 Aug 2005 16:45:25 -0000 1.66
+++ server/gam_poll.c 5 Aug 2005 18:06:18 -0000
@@ -250,7 +250,7 @@
GAM_DEBUG(DEBUG_INFO, "node_add_subscription(%s)\n", node->path);
gam_node_add_subscription(node, sub);
- if (gam_exclude_check(node->path)) {
+ if (gam_exclude_check(node->path) || gam_fs_get_mon_type (node->path) == GFS_MT_POLL) {
GAM_DEBUG(DEBUG_INFO, " gam_exclude_check: true\n");
if (node->lasttime == 0)
poll_file(node);
@@ -293,7 +293,7 @@
gam_node_remove_subscription(node, sub);
path = node->path;
- if (gam_exclude_check(path)) {
+ if (gam_exclude_check(path) || gam_fs_get_mon_type (path) == GFS_MT_POLL) {
GAM_DEBUG(DEBUG_INFO, " gam_exclude_check: true\n");
return (0);
}
@@ -361,7 +361,7 @@
path = gam_node_get_path(node);
GAM_DEBUG(DEBUG_INFO, "gam_poll_delist_node %s\n", path);
- if (gam_exclude_check(path))
+ if (gam_exclude_check(path) || gam_fs_get_mon_type (path) != GFS_MT_KERNEL)
return;
subs = gam_node_get_subscriptions(node);
@@ -390,8 +390,9 @@
path = gam_node_get_path(node);
GAM_DEBUG(DEBUG_INFO, "gam_poll_relist_node %s\n", path);
- if (gam_exclude_check(path))
+ if (gam_exclude_check(path) || gam_fs_get_mon_type(path) != GFS_MT_KERNEL)
return;
+
subs = gam_node_get_subscriptions(node);
while (subs != NULL) {
@@ -416,11 +417,12 @@
const char *path;
path = gam_node_get_path(node);
- GAM_DEBUG(DEBUG_INFO, "gam_poll_flowon_node %s\n", path);
- if (gam_exclude_check(path))
+ if (gam_exclude_check(path) || gam_fs_get_mon_type(path) != GFS_MT_KERNEL)
return;
+ GAM_DEBUG(DEBUG_INFO, "gam_poll_flowon_node %s\n", path);
+
if (gam_node_is_dir(node))
trigger_dir_handler(path, GAMIN_FLOWCONTROLSTART, node);
else
@@ -440,10 +442,12 @@
const char *path;
path = gam_node_get_path(node);
- GAM_DEBUG(DEBUG_INFO, "gam_poll_flowoff_node %s\n", path);
- if (gam_exclude_check(path))
+
+ if (gam_exclude_check(path) || gam_fs_get_mon_type(path) != GFS_MT_KERNEL)
return;
+ GAM_DEBUG(DEBUG_INFO, "gam_poll_flowoff_node %s\n", path);
+
if (gam_node_is_dir(node))
trigger_dir_handler(path, GAMIN_FLOWCONTROLSTOP, node);
else
@@ -475,7 +479,7 @@
node->pflags |= MON_MISSING;
else
gam_node_set_is_dir(node, (S_ISDIR(sbuf.st_mode) != 0));
- if (gam_exclude_check(path))
+ if (gam_exclude_check(path) || gam_fs_get_mon_type (path) != GFS_MT_KERNEL)
node->pflags |= MON_NOKERNEL;
memcpy(&(node->sbuf), &(sbuf), sizeof(struct stat));
node->lasttime = current_time;
@@ -572,7 +576,7 @@
if ((node->checks >= 4) && (!(node->pflags & MON_BUSY))) {
if ((gam_node_get_subscriptions(node) != NULL) &&
- (!gam_exclude_check(node->path))) {
+ (!gam_exclude_check(node->path) && gam_fs_get_mon_type (node->path) == GFS_MT_KERNEL)) {
GAM_DEBUG(DEBUG_INFO, "switching %s back to polling\n", path);
node->pflags |= MON_BUSY;
node->checks = 0;
@@ -596,7 +600,7 @@
if ((event == 0) && (node->pflags & MON_BUSY) && (node->checks > 5)) {
if ((gam_node_get_subscriptions(node) != NULL) &&
- (!gam_exclude_check(node->path))) {
+ (!gam_exclude_check(node->path) && gam_fs_get_mon_type (node->path) == GFS_MT_KERNEL)) {
GAM_DEBUG(DEBUG_INFO,
"switching %s back to kernel monitoring\n", path);
node->pflags &= ~MON_BUSY;
@@ -818,7 +822,7 @@
* if the resource exists again and is not in a special monitoring
* mode then switch back to dnotify for monitoring.
*/
- if ((node->pflags == 0) && (!gam_exclude_check(node->path))) {
+ if ((node->pflags == 0) && (!gam_exclude_check(node->path) && gam_fs_get_mon_type (node->path) == GFS_MT_KERNEL)) {
gam_poll_remove_missing(node);
if (gam_node_get_subscriptions(node) != NULL) {
gam_poll_relist_node(node);
@@ -856,7 +860,7 @@
* if the resource exists again and is not in a special monitoring
* mode then switch back to dnotify for monitoring.
*/
- if ((node->pflags == 0) && (!gam_exclude_check(node->path))) {
+ if ((node->pflags == 0) && (!gam_exclude_check(node->path) && gam_fs_get_mon_type (node->path) == GFS_MT_KERNEL)) {
gam_poll_remove_busy(node);
if (gam_node_get_subscriptions(node) != NULL) {
gam_poll_flowoff_node(node);
@@ -1219,7 +1223,7 @@
}
stat(node->path, &(node->sbuf));
gam_node_set_is_dir(node, (S_ISDIR(node->sbuf.st_mode) != 0));
- if (gam_exclude_check(path))
+ if (gam_exclude_check(path) || gam_fs_get_mon_type(path) != GFS_MT_KERNEL)
node->pflags |= MON_NOKERNEL;
node->lasttime = current_time;
gam_tree_add(tree, dir_node, node);
Index: server/gam_server.c
===================================================================
RCS file: /cvs/gnome/gamin/server/gam_server.c,v
retrieving revision 1.31
diff -u -r1.31 gam_server.c
--- server/gam_server.c 5 Aug 2005 12:08:57 -0000 1.31
+++ server/gam_server.c 5 Aug 2005 18:06:18 -0000
@@ -159,17 +159,26 @@
gboolean
gam_add_subscription(GamSubscription * sub)
{
- gam_fs_mon_type type;
+ const char *path = NULL;
+
if (sub == NULL)
return(FALSE);
- type = gam_fs_get_mon_type (gam_subscription_get_path (sub));
- if (type == GFS_MT_KERNEL)
- return (gam_backend_add_subscription(sub));
- else if (type == GFS_MT_POLL)
+ path = gam_subscription_get_path (sub);
+
+ if (gam_exclude_check (path))
+ {
return gam_poll_add_subscription (sub);
- else
- return FALSE;
+ } else {
+ gam_fs_mon_type type;
+ type = gam_fs_get_mon_type (path);
+ if (type == GFS_MT_KERNEL)
+ return (gam_backend_add_subscription(sub));
+ else if (type == GFS_MT_POLL)
+ return gam_poll_add_subscription (sub);
+ }
+
+ return FALSE;
}
/**
@@ -182,19 +191,26 @@
gboolean
gam_remove_subscription(GamSubscription * sub)
{
- gam_fs_mon_type type;
+ const char *path = NULL;
if (sub == NULL)
return(FALSE);
- type = gam_fs_get_mon_type (gam_subscription_get_path (sub));
+ path = gam_subscription_get_path (sub);
- if (type == GFS_MT_KERNEL)
- return (gam_backend_remove_subscription(sub));
- else if (type == GFS_MT_POLL)
+ if (gam_exclude_check (path))
+ {
return gam_poll_remove_subscription (sub);
- else
- return FALSE;
+ } else {
+ gam_fs_mon_type type;
+ type = gam_fs_get_mon_type (path);
+ if (type == GFS_MT_KERNEL)
+ return (gam_backend_remove_subscription(sub));
+ else if (type == GFS_MT_POLL)
+ return gam_poll_remove_subscription (sub);
+ }
+
+ return FALSE;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]