Mercurial > prosody-hg
comparison plugins/mod_version.lua @ 13476:b9267ce1b183
mod_version: Fix uname result style (thanks riau)
`result[, err]`, not `ok, err|result`, must have confused it with pcall
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 07 Apr 2024 18:36:00 +0200 |
| parents | 05c1098084cd |
| children |
comparison
equal
deleted
inserted
replaced
| 13475:c14659710747 | 13476:b9267ce1b183 |
|---|---|
| 20 platform = "Windows"; | 20 platform = "Windows"; |
| 21 else | 21 else |
| 22 local os_version_command = module:get_option_string("os_version_command"); | 22 local os_version_command = module:get_option_string("os_version_command"); |
| 23 local ok, pposix = pcall(require, "prosody.util.pposix"); | 23 local ok, pposix = pcall(require, "prosody.util.pposix"); |
| 24 if not os_version_command and (ok and pposix and pposix.uname) then | 24 if not os_version_command and (ok and pposix and pposix.uname) then |
| 25 local ok, uname = pposix.uname(); | 25 local uname, err = pposix.uname(); |
| 26 if not ok then | 26 if not uname then |
| 27 module:log("debug", "Could not retrieve OS name: %s", uname); | 27 module:log("debug", "Could not retrieve OS name: %s", err); |
| 28 else | 28 else |
| 29 platform = uname.sysname; | 29 platform = uname.sysname; |
| 30 end | 30 end |
| 31 end | 31 end |
| 32 if not platform then | 32 if not platform then |
