chiark
/
gitweb
/
~cjwatson
/
bin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c97e81
)
bsmtp-pull: Note race condition pointed out by Peter Benie.
author
Colin Watson
<cjwatson@chiark.greenend.org.uk>
Sun, 11 Jul 2004 22:34:59 +0000
(22:34 +0000)
committer
Colin Watson
<cjwatson@chiark.greenend.org.uk>
Sun, 11 Jul 2004 22:34:59 +0000
(22:34 +0000)
bsmtp-pull
patch
|
blob
|
history
diff --git
a/bsmtp-pull
b/bsmtp-pull
index 5c95f92e4c067b2e1a149b2487f8b595c9494056..600763d58e4540b7cd1c6f2ee912aea9fbd3cbd1 100755
(executable)
--- a/
bsmtp-pull
+++ b/
bsmtp-pull
@@
-19,6
+19,8
@@
HOST="$1"
# By default, lockfile-create gives up after three minutes, so don't cron
# this any more frequently than that without supplying a --retry argument.
lockfile-create "$HOST"
+# Race condition pointed out by pjb: this doesn't guarantee that the lock is
+# held before the critical section starts.
lockfile-touch "$HOST" &
TOUCH="$!"
trap 'kill "$TOUCH"; lockfile-remove "$HOST"' EXIT ERR HUP INT QUIT TERM