libs/core: Replace luci.sys.bigendian with a system independent version
This commit is contained in:
parent
206bf7f253
commit
3899482aca
1 changed files with 3 additions and 7 deletions
|
@ -31,14 +31,10 @@ require("luci.bits")
|
||||||
require("luci.util")
|
require("luci.util")
|
||||||
require("luci.fs")
|
require("luci.fs")
|
||||||
|
|
||||||
--- Test wheather the current system is operating in big endian mode.
|
--- Test whether the current system is operating in big endian mode.
|
||||||
-- @return Boolean value indicating wheather system is big endian
|
-- @return Boolean value indicating whether system is big endian
|
||||||
function bigendian()
|
function bigendian()
|
||||||
local fp = io.open("/bin/sh")
|
return string.byte(string.dump(function() end), 7) == 0
|
||||||
fp:seek("set", 5)
|
|
||||||
local be = (fp:read(1):byte() ~= 1)
|
|
||||||
fp:close()
|
|
||||||
return be
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Execute given commandline and gather stdout.
|
--- Execute given commandline and gather stdout.
|
||||||
|
|
Loading…
Reference in a new issue