Mercurial > prosody-hg
comparison plugins/mod_posix.lua @ 3026:dec4527a7499
mod_posix: Fixed a global access.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Fri, 07 May 2010 16:04:45 +0500 |
| parents | b7049746bd29 |
| children | e095d2a98936 |
comparison
equal
deleted
inserted
replaced
| 3018:d7c80d23ed21 | 3026:dec4527a7499 |
|---|---|
| 77 if pidfile_handle then | 77 if pidfile_handle then |
| 78 remove_pidfile(); | 78 remove_pidfile(); |
| 79 end | 79 end |
| 80 pidfile = module:get_option("pidfile"); | 80 pidfile = module:get_option("pidfile"); |
| 81 if pidfile then | 81 if pidfile then |
| 82 local err; | |
| 82 local mode = stat(pidfile) and "r+" or "w+"; | 83 local mode = stat(pidfile) and "r+" or "w+"; |
| 83 pidfile_handle, err = io.open(pidfile, mode); | 84 pidfile_handle, err = io.open(pidfile, mode); |
| 84 if not pidfile_handle then | 85 if not pidfile_handle then |
| 85 module:log("error", "Couldn't write pidfile at %s; %s", pidfile, err); | 86 module:log("error", "Couldn't write pidfile at %s; %s", pidfile, err); |
| 86 prosody.shutdown("Couldn't write pidfile"); | 87 prosody.shutdown("Couldn't write pidfile"); |
