aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-08-24 17:35:53 -0400
committerJoey Hess <joey@kitenet.net>2011-08-24 17:35:53 -0400
commitc8f7dcbc3107fb4cc0b60958d5b10f4ea154054d (patch)
tree69e2a54519bea480f8392fc0e91ce22fe0dfc27e /IkiWiki
parentbb1f713f8d54ea8d2cf877a4c275674b8236c9d5 (diff)
downloadikiwiki-c8f7dcbc3107fb4cc0b60958d5b10f4ea154054d.tar
ikiwiki-c8f7dcbc3107fb4cc0b60958d5b10f4ea154054d.tar.gz
Use lockf rather than flock when taking the cgilock, for better portability.
This kind of change is scary, but this particular lock is very simply used and so it seems ok to make it even just for better portability to SunOS. (People still use that?)
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Wrapper.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
index d39a3ea40..c39aa2ef7 100644
--- a/IkiWiki/Wrapper.pm
+++ b/IkiWiki/Wrapper.pm
@@ -95,7 +95,7 @@ EOF
# IKIWIKI_CGILOCK_FD so unlockwiki can close it.
$pre_exec=<<"EOF";
lockfd=open("$config{wikistatedir}/cgilock", O_CREAT | O_RDWR, 0666);
- if (lockfd != -1 && flock(lockfd, LOCK_EX) == 0) {
+ if (lockfd != -1 && lockf(lockfd, F_LOCK, 0) == 0) {
char *fd_s=malloc(8);
sprintf(fd_s, "%i", lockfd);
setenv("IKIWIKI_CGILOCK_FD", fd_s, 1);