1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 073_configurable_locking.dpatch
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
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
18 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
19 @@ -4308,6 +4309,23 @@
23 +# Disable use of locking when spawning mount command
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"
32 +if test x$enable_mount_locking = xyes -o x$enableval = xyes; then
33 + cat >>confdefs.h <<\_ACEOF
34 +#define ENABLE_MOUNT_LOCKING 1
40 # Write Makefile.conf and include/config.h
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
50 +# Disable use of locking when spawning mount command
52 +AC_ARG_ENABLE(mount-locking,
53 +--disable-mount-locking disable use of locking when spawning mount command,,
55 +if test x$enable_mount_locking = xyes -o x$enableval = xyes; then
56 + AC_DEFINE(ENABLE_MOUNT_LOCKING, 1)
60 # Write Makefile.conf and include/config.h
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
67 return do_spawn(logpri, 0, prog, (const char **) argv);
70 +#ifdef ENABLE_MOUNT_LOCKING
71 int spawnll(int logpri, const char *prog, ...)
76 return do_spawn(logpri, 1, prog, (const char **) argv);
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
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, ...);
92 +#define spawnll spawnl
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
102 #undef HAVE_SLOPPY_MOUNT
104 #undef ENABLE_EXT_ENV
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
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) {
115 + /* proceed anyway */
117 +- we_created_lockfile = 1;
118 ++ we_created_lockfile = fd;
120 + static int tries = 0;
122 +@@ -510,9 +510,8 @@ lock_mtab (void) {
133 +@@ -520,6 +519,7 @@ lock_mtab (void) {
135 + unlock_mtab (void) {
136 + if (we_created_lockfile) {
137 ++ close(we_created_lockfile);
138 + unlink (MOUNTED_LOCK);
139 + we_created_lockfile = 0;
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
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
148 + unlock_mtab (void) {
149 + if (we_created_lockfile) {
150 + unlink (MOUNTED_LOCK);
151 ++ close(we_created_lock_file);
152 + we_created_lockfile = 0;
157 + /* proceed anyway */
159 ++ we_created_lock_file = fd;
161 + static int tries = 0;