1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

Further extend the previous patches to make sure that excluded paths

do not get opened (but rather they will be polled).
This commit is contained in:
Joe Marcus Clarke 2009-05-02 01:01:53 +00:00
parent 2e08ddf670
commit bcb2b2eb2e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=233118
3 changed files with 34 additions and 10 deletions

View File

@ -8,7 +8,7 @@
PORTNAME= gamin
PORTVERSION= 0.1.10
PORTREVISION?= 1
PORTREVISION?= 2
CATEGORIES?= devel
MASTER_SITES= http://www.gnome.org/~veillard/gamin/sources/

View File

@ -1,5 +1,5 @@
--- server/gam_kqueue.c.orig 2007-07-04 09:50:41.000000000 -0400
+++ server/gam_kqueue.c 2007-08-10 15:03:59.000000000 -0400
+++ server/gam_kqueue.c 2009-05-01 20:52:14.000000000 -0400
@@ -10,9 +10,10 @@
* FAM should do: we do not call g_dir_open() if the file is a
* symbolic link).
@ -37,7 +37,15 @@
#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/stat.h>
@@ -326,7 +329,7 @@ gam_kqueue_isdir (const char *pathname,
@@ -62,6 +65,7 @@
#include "gam_error.h"
#include "gam_kqueue.h"
#include "gam_event.h"
+#include "gam_excludes.h"
#include "gam_server.h"
#include "gam_poll_basic.h"
@@ -326,7 +330,7 @@ gam_kqueue_isdir (const char *pathname,
static gboolean
gam_kqueue_get_uint_sysctl (const char *name, unsigned int *value)
{
@ -46,7 +54,7 @@
if (sysctlbyname(name, value, &value_len, (void *)NULL, 0) < 0)
{
@@ -509,6 +512,9 @@ static gboolean
@@ -509,33 +513,52 @@ static gboolean
gam_kqueue_monitor_enable_kqueue (Monitor *mon)
{
struct kevent ev[1];
@ -56,9 +64,15 @@
if (open_files == max_open_files)
{
@@ -516,26 +522,36 @@ gam_kqueue_monitor_enable_kqueue (Monito
GAM_DEBUG(DEBUG_INFO, "cannot open %s (max_open_files limit reached), falling back to poll\n", mon->pathname);
return FALSE;
}
+
+ if (gam_exclude_check(mon->pathname))
+ {
+ GAM_DEBUG(DEBUG_INFO, "not using kqueue for %s since it is excluded, falling back to poll\n", mon->pathname);
+ return FALSE;
+ }
- mon->fd = open(mon->pathname, O_RDONLY | O_NOFOLLOW);
+ mon->fd = open(mon->pathname, O_RDONLY | O_NONBLOCK | O_NOFOLLOW);
@ -99,7 +113,7 @@
}
static void
@@ -840,6 +856,8 @@ gam_kqueue_sub_monitor_emit_event (SubMo
@@ -840,6 +863,8 @@ gam_kqueue_sub_monitor_emit_event (SubMo
case GAMIN_EVENT_MOVED:
gam_kqueue_sub_monitor_set_missing(smon);
break;
@ -108,7 +122,7 @@
}
gam_server_emit_event(mon->pathname, isdir, event, smon->subs, 1);
@@ -981,6 +999,8 @@ gam_kqueue_file_monitor_emit_event (File
@@ -981,6 +1006,8 @@ gam_kqueue_file_monitor_emit_event (File
gam_kqueue_hash_table_remove(fmon->smon->fmons, fmon);
break;
@ -117,7 +131,7 @@
}
}
@@ -1167,6 +1187,9 @@ gam_kqueue_init (void)
@@ -1167,6 +1194,9 @@ gam_kqueue_init (void)
channel = g_io_channel_unix_new(kq);
g_io_add_watch(channel, G_IO_IN, gam_kqueue_kevent_cb, NULL);

View File

@ -1,5 +1,5 @@
--- server/gam_server.c.orig 2007-07-04 09:36:49.000000000 -0400
+++ server/gam_server.c 2009-04-15 22:37:01.000000000 -0400
+++ server/gam_server.c 2009-05-01 20:25:41.000000000 -0400
@@ -32,7 +32,7 @@
#include "gam_server.h"
#include "gam_channel.h"
@ -19,7 +19,17 @@
} else {
gam_fs_mon_type type;
type = gam_fs_get_mon_type (path);
@@ -438,7 +439,7 @@ gam_server_get_kernel_handler (void)
@@ -243,7 +244,8 @@ gam_remove_subscription(GamSubscription
return gam_poll_remove_subscription (sub);
else
#endif
- return gam_kernel_remove_subscription(sub);
+ /*return gam_kernel_remove_subscription(sub);*/
+ return gam_poll_remove_subscription (sub);
} else {
gam_fs_mon_type type;
type = gam_fs_get_mon_type (path);
@@ -438,7 +440,7 @@ gam_server_get_kernel_handler (void)
GamPollHandler
gam_server_get_poll_handler (void)
{