Use uname instead of /proc for reading the system hostname
[project/luci.git] / libs / sys / luasrc / sys.lua
index e8b5e2c..2edb8f0 100644 (file)
@@ -132,7 +132,7 @@ getenv = posix.getenv
 --- Determine the current hostname.
 -- @return             String containing the system hostname
 function hostname()
-       return io.lines("/proc/sys/kernel/hostname")()
+       return posix.uname("%n")
 end
 
 --- Returns the contents of a documented referred by an URL.