# HG changeset patch # User Matthew Wild # Date 1263341078 0 # Node ID 1e287badd033edde73c84604a62628f5e0ddb859 # Parent d6fcd13c07e7630d289c601cb9f065a2ef1927aa prosodyctl: Use mode r+ for opening the file so 1) it fails if the file doesn't exist 2) we have write access to lock it diff -r d6fcd13c07e7 -r 1e287badd033 util/prosodyctl.lua --- a/util/prosodyctl.lua Wed Jan 13 00:03:22 2010 +0000 +++ b/util/prosodyctl.lua Wed Jan 13 00:04:38 2010 +0000 @@ -65,7 +65,7 @@ return false, "no-pidfile"; end - local file, err = io.open(pidfile, "w"); + local file, err = io.open(pidfile, "r+"); if not file then return false, "pidfile-read-failed", err; end