relocate packages on recipes-base/recipes-enigma2/recipes-wlan.
[vuplus_openvuplus] / meta-openvuplus / recipes-connectivity / autofs / autofs-4.1.4 / 073_configurable_locking.patch
1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 073_configurable_locking.dpatch
3 ##
4 ## DP: No description.
5
6 @DPATCH@
7
8 diff -Naur .B/configure .A/configure
9 --- .B/configure        2005-04-06 15:24:37.000000000 +0000
10 +++ .A/configure        2007-01-07 21:36:36.000000000 +0000
11 @@ -842,6 +842,7 @@
12    --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
13    --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
14  --disable-ext-env          disable search in environment for substitution variable
15 +--disable-mount-locking          disable use of locking when spawning mount command
16  
17  Optional Packages:
18    --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
19 @@ -4308,6 +4309,23 @@
20  fi
21  
22  #
23 +# Disable use of locking when spawning mount command
24 +#
25 +# Check whether --enable-mount-locking or --disable-mount-locking was given.
26 +if test "${enable_mount_locking+set}" = set; then
27 +  enableval="$enable_mount_locking"
28 +
29 +else
30 +  enableval=yes
31 +fi;
32 +if test x$enable_mount_locking = xyes -o x$enableval = xyes; then
33 +       cat >>confdefs.h <<\_ACEOF
34 +#define ENABLE_MOUNT_LOCKING 1
35 +_ACEOF
36 +
37 +fi
38 +
39 +#
40  # Write Makefile.conf and include/config.h
41  #
42            ac_config_headers="$ac_config_headers include/config.h"
43 diff -Naur .B/configure.in .A/configure.in
44 --- .B/configure.in     2005-04-06 15:24:37.000000000 +0000
45 +++ .A/configure.in     2007-01-07 21:36:36.000000000 +0000
46 @@ -167,6 +167,16 @@
47  fi
48  
49  #
50 +# Disable use of locking when spawning mount command
51 +#
52 +AC_ARG_ENABLE(mount-locking,
53 +--disable-mount-locking          disable use of locking when spawning mount command,,
54 +       enableval=yes)
55 +if test x$enable_mount_locking = xyes -o x$enableval = xyes; then
56 +       AC_DEFINE(ENABLE_MOUNT_LOCKING, 1)
57 +fi
58 +
59 +#
60  # Write Makefile.conf and include/config.h
61  #
62  AC_CONFIG_HEADER(include/config.h)
63 diff -Naur .B/daemon/spawn.c .A/daemon/spawn.c
64 --- .B/daemon/spawn.c   2005-02-10 12:56:53.000000000 +0000
65 +++ .A/daemon/spawn.c   2007-01-07 21:36:36.000000000 +0000
66 @@ -322,6 +322,7 @@
67         return do_spawn(logpri, 0, prog, (const char **) argv);
68  }
69  
70 +#ifdef ENABLE_MOUNT_LOCKING
71  int spawnll(int logpri, const char *prog, ...)
72  {
73         va_list arg;
74 @@ -342,3 +343,4 @@
75  
76         return do_spawn(logpri, 1, prog, (const char **) argv);
77  }
78 +#endif
79 diff -Naur .B/include/automount.h .A/include/automount.h
80 --- .B/include/automount.h      2005-01-26 13:03:02.000000000 +0000
81 +++ .A/include/automount.h      2007-01-07 21:36:36.000000000 +0000
82 @@ -121,9 +121,13 @@
83  
84  int aquire_lock(void);
85  void release_lock(void);
86 -int spawnll(int logpri, const char *prog, ...);
87  int spawnl(int logpri, const char *prog, ...);
88 -int spawnv(int logpri, const char *prog, const char *const *argv);
89 +#ifdef ENABLE_MOUNT_LOCKING
90 +int spawnll(int logpri, const char *prog, ...);
91 +#else
92 +#define spawnll        spawnl
93 +#endif
94 +int spawnv(int ogpri, const char *prog, const char *const *argv);
95  void reset_signals(void);
96  void ignore_signals(void);
97  void discard_pending(int sig);
98 diff -Naur .B/include/config.h.in .A/include/config.h.in
99 --- .B/include/config.h.in      2004-02-03 15:23:21.000000000 +0000
100 +++ .A/include/config.h.in      2007-01-07 21:36:36.000000000 +0000
101 @@ -25,3 +25,5 @@
102  #undef HAVE_SLOPPY_MOUNT
103  
104  #undef ENABLE_EXT_ENV
105 +
106 +#undef ENABLE_MOUNT_LOCKING
107 diff -Naur .B/patches/util-linux-2.12a-flock.patch .A/patches/util-linux-2.12a-flock.patch
108 --- .B/patches/util-linux-2.12a-flock.patch     1970-01-01 00:00:00.000000000 +0000
109 +++ .A/patches/util-linux-2.12a-flock.patch     2007-01-07 21:36:36.000000000 +0000
110 @@ -0,0 +1,30 @@
111 +--- util-linux-2.12a/mount/fstab.c.flock       2005-09-17 01:36:03.000000000 +0800
112 ++++ util-linux-2.12a/mount/fstab.c     2005-09-17 01:41:12.000000000 +0800
113 +@@ -488,7 +488,7 @@ lock_mtab (void) {
114 +                               }
115 +                               /* proceed anyway */
116 +                       }
117 +-                      we_created_lockfile = 1;
118 ++                      we_created_lockfile = fd;
119 +               } else {
120 +                       static int tries = 0;
121
122 +@@ -510,9 +510,8 @@ lock_mtab (void) {
123 +                                            MOUNTED_LOCK);
124 +                               sleep(1);
125 +                       }
126 ++                      close(fd);
127 +               }
128 +-
129 +-              close(fd);
130 +       }
131 + }
132
133 +@@ -520,6 +519,7 @@ lock_mtab (void) {
134 + void
135 + unlock_mtab (void) {
136 +       if (we_created_lockfile) {
137 ++              close(we_created_lockfile);
138 +               unlink (MOUNTED_LOCK);
139 +               we_created_lockfile = 0;
140 +       }
141 diff -Naur .B/patches/util-linux-2.12q-flock.patch .A/patches/util-linux-2.12q-flock.patch
142 --- .B/patches/util-linux-2.12q-flock.patch     1970-01-01 00:00:00.000000000 +0000
143 +++ .A/patches/util-linux-2.12q-flock.patch     2007-01-07 21:36:36.000000000 +0000
144 @@ -0,0 +1,29 @@
145 +--- util-linux-2.12q/mount/fstab.c.flock       2005-09-17 01:10:37.000000000 +0800
146 ++++ util-linux-2.12q/mount/fstab.c     2005-09-17 01:16:51.000000000 +0800
147 +@@ -417,6 +417,7 @@
148 + unlock_mtab (void) {
149 +       if (we_created_lockfile) {
150 +               unlink (MOUNTED_LOCK);
151 ++              close(we_created_lock_file);
152 +               we_created_lockfile = 0;
153 +       }
154 + }
155 +@@ -528,6 +529,7 @@
156 +                               }
157 +                               /* proceed anyway */
158 +                       }
159 ++                      we_created_lock_file = fd;
160 +               } else {
161 +                       static int tries = 0;
162
163 +@@ -549,9 +551,8 @@
164 +                                            MOUNTED_LOCK);
165 +                               sleep(1);
166 +                       }
167 ++                      close(fd);
168 +               }
169 +-
170 +-              close(fd);
171 +       }
172 + }
173