Software /
code /
prosody
Comparison
plugins/mod_posix.lua @ 7992:51396e0836cf
mod_posix: Use path variant of config API for pidfile option
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 21 Mar 2017 12:08:29 +0100 |
parent | 7731:a0ee83c4a82c |
child | 7999:980606856882 |
child | 8010:49feb0da29e1 |
comparison
equal
deleted
inserted
replaced
7991:35a02ba83af2 | 7992:51396e0836cf |
---|---|
78 | 78 |
79 local function write_pidfile() | 79 local function write_pidfile() |
80 if pidfile_handle then | 80 if pidfile_handle then |
81 remove_pidfile(); | 81 remove_pidfile(); |
82 end | 82 end |
83 pidfile = module:get_option_string("pidfile"); | 83 pidfile = module:get_option_path("pidfile", nil, "data"); |
84 if pidfile then | 84 if pidfile then |
85 local err; | 85 local err; |
86 local mode = stat(pidfile) and "r+" or "w+"; | 86 local mode = stat(pidfile) and "r+" or "w+"; |
87 pidfile_handle, err = io.open(pidfile, mode); | 87 pidfile_handle, err = io.open(pidfile, mode); |
88 if not pidfile_handle then | 88 if not pidfile_handle then |