1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
3
/* inotify-helper.c - Gnome VFS Monitor based on inotify.
5
Copyright (C) 2005 John McCutchan
7
The Gnome Library is free software; you can redistribute it and/or
8
modify it under the terms of the GNU Library General Public License as
9
published by the Free Software Foundation; either version 2 of the
10
License, or (at your option) any later version.
12
The Gnome Library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Library General Public License for more details.
17
You should have received a copy of the GNU Library General Public
18
License along with the Gnome Library; see the file COPYING.LIB. If not,
19
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
Boston, MA 02111-1307, USA.
23
John McCutchan <john@johnmccutchan.com>
28
#include <sys/types.h>
30
#include "inotify-missing.h"
31
#include "inotify-path.h"
32
#include "inotify-diag.h"
34
#define DIAG_DUMP_TIME 20000 /* 20 seconds */
36
G_LOCK_EXTERN (inotify_lock);
39
id_dump (gpointer userdata)
44
G_LOCK (inotify_lock);
48
fname = g_strdup_printf ("/tmp/gvfsid.%d", pid);
49
ioc = g_io_channel_new_file (fname, "w", NULL);
54
G_UNLOCK (inotify_lock);
60
g_io_channel_shutdown (ioc, TRUE, NULL);
61
g_io_channel_unref (ioc);
63
G_UNLOCK (inotify_lock);
70
if (!g_getenv ("GVFS_INOTIFY_DIAG"))
73
g_timeout_add (DIAG_DUMP_TIME, id_dump, NULL);