Tizen 2.1 base
[framework/base/fuse.git] / debian / patches / 01_inotify.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 01_inotify.dpatch by Youngjae Shin <yj99.shin@samsung.com>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: fix the removing inotify
6
7 @DPATCH@
8
9 diff -urN fuse-2.orig/lib/fuse.c fuse-2/lib/fuse.c
10 --- fuse-2.orig/lib/fuse.c      2010-02-10 09:35:29.000000000 +0900
11 +++ fuse-2/lib/fuse.c   2010-02-10 09:43:59.000000000 +0900
12 @@ -780,6 +780,7 @@
13         free(path2);
14  }
15  
16 +#define FIX_INOTIFY_BROKEN
17  static void forget_node(struct fuse *f, fuse_ino_t nodeid, uint64_t nlookup)
18  {
19         struct node *node;
20 @@ -805,11 +806,28 @@
21         }
22  
23         assert(node->nlookup >= nlookup);
24 +#ifdef FIX_INOTIFY_BROKEN
25 +       struct node *temp_node;
26 +       int i;
27 +
28 +       for(i=0;i<f->id_table_size;i++) {
29 +               temp_node = f->id_table[i];
30 +               while(temp_node) {
31 +                       if(temp_node->parent == node)
32 +                               goto donot_forget;
33 +                       temp_node = temp_node->id_next;
34 +               }
35 +       }
36 +#endif
37         node->nlookup -= nlookup;
38         if (!node->nlookup) {
39                 unhash_name(f, node);
40                 unref_node(f, node);
41         }
42 +
43 +#ifdef FIX_INOTIFY_BROKEN
44 +donot_forget:
45 +#endif
46         pthread_mutex_unlock(&f->lock);
47  }
48