Software /
code /
prosody
Comparison
plugins/mod_posix.lua @ 12977:74b9e05af71e
plugins: Prefix module imports with prosody namespace
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 24 Mar 2023 13:15:28 +0100 |
parent | 12297:249eb306f668 |
child | 13452:69faf3552d52 |
comparison
equal
deleted
inserted
replaced
12976:a187600ec7d6 | 12977:74b9e05af71e |
---|---|
7 -- | 7 -- |
8 | 8 |
9 | 9 |
10 local want_pposix_version = "0.4.0"; | 10 local want_pposix_version = "0.4.0"; |
11 | 11 |
12 local pposix = assert(require "util.pposix"); | 12 local pposix = assert(require "prosody.util.pposix"); |
13 if pposix._VERSION ~= want_pposix_version then | 13 if pposix._VERSION ~= want_pposix_version then |
14 module:log("warn", "Unknown version (%s) of binary pposix module, expected %s." | 14 module:log("warn", "Unknown version (%s) of binary pposix module, expected %s." |
15 .. "Perhaps you need to recompile?", tostring(pposix._VERSION), want_pposix_version); | 15 .. "Perhaps you need to recompile?", tostring(pposix._VERSION), want_pposix_version); |
16 end | 16 end |
17 | 17 |
18 local have_signal, signal = pcall(require, "util.signal"); | 18 local have_signal, signal = pcall(require, "prosody.util.signal"); |
19 if not have_signal then | 19 if not have_signal then |
20 module:log("warn", "Couldn't load signal library, won't respond to SIGTERM"); | 20 module:log("warn", "Couldn't load signal library, won't respond to SIGTERM"); |
21 end | 21 end |
22 | 22 |
23 local lfs = require "lfs"; | 23 local lfs = require "lfs"; |
95 -- TODO: Write some docs and include a link in the warning. | 95 -- TODO: Write some docs and include a link in the warning. |
96 end | 96 end |
97 end | 97 end |
98 | 98 |
99 local function remove_log_sinks() | 99 local function remove_log_sinks() |
100 local lm = require "core.loggingmanager"; | 100 local lm = require "prosody.core.loggingmanager"; |
101 lm.register_sink_type("console", nil); | 101 lm.register_sink_type("console", nil); |
102 lm.register_sink_type("stdout", nil); | 102 lm.register_sink_type("stdout", nil); |
103 lm.reload_logging(); | 103 lm.reload_logging(); |
104 end | 104 end |
105 | 105 |