Software /
code /
prosody-modules
Comparison
mod_debug_traceback/mod_debug_traceback.lua @ 5874:0358fcf14cd6
mod_debug_traceback: Remove direct POSIX signal handling, require Prosody 0.12+
Hooking an event is safer than directly hooking signals
For context see Prosody trunk rev 69faf3552d52
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 02 Mar 2024 14:42:27 +0100 |
parent | 4222:02292b892fce |
comparison
equal
deleted
inserted
replaced
5873:84a784bc4096 | 5874:0358fcf14cd6 |
---|---|
44 f:write("-- End of traceback --\n"); | 44 f:write("-- End of traceback --\n"); |
45 f:close(); | 45 f:close(); |
46 count = count + 1; | 46 count = count + 1; |
47 end | 47 end |
48 | 48 |
49 local mod_posix = module:depends("posix"); | 49 module:hook("signal/"..signal_name, dump_traceback); |
50 if rawget(mod_posix, "features") and mod_posix.features.signal_events then | |
51 module:hook("signal/"..signal_name, dump_traceback); | |
52 else | |
53 require"util.signal".signal(signal_name, dump_traceback); | |
54 end |