equal
deleted
inserted
replaced
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 platform = pposix.uname().sysname; |
25 local ok, uname = pposix.uname(); |
|
26 if not ok then |
|
27 module:log("debug", "Could not retrieve OS name: %s", uname); |
|
28 else |
|
29 platform = uname.sysname; |
|
30 end |
26 end |
31 end |
27 if not platform then |
32 if not platform then |
28 local uname = io.popen(os_version_command or "uname"); |
33 local uname = io.popen(os_version_command or "uname"); |
29 if uname then |
34 if uname then |
30 platform = uname:read("*a"); |
35 platform = uname:read("*a"); |