projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
206bf7f
)
libs/core: Replace luci.sys.bigendian with a system independent version
author
Steven Barth
<steven@midlink.org>
Wed, 6 Aug 2008 19:26:35 +0000
(19:26 +0000)
committer
Steven Barth
<steven@midlink.org>
Wed, 6 Aug 2008 19:26:35 +0000
(19:26 +0000)
libs/core/luasrc/sys.lua
patch
|
blob
|
history
diff --git
a/libs/core/luasrc/sys.lua
b/libs/core/luasrc/sys.lua
index
217a36b
..
8e8aab7
100644
(file)
--- a/
libs/core/luasrc/sys.lua
+++ b/
libs/core/luasrc/sys.lua
@@
-31,14
+31,10
@@
require("luci.bits")
require("luci.util")
require("luci.fs")
require("luci.util")
require("luci.fs")
---- Test whe
a
ther the current system is operating in big endian mode.
--- @return Boolean value indicating whe
a
ther system is big endian
+--- Test whether the current system is operating in big endian mode.
+-- @return Boolean value indicating whether system is big endian
function bigendian()
function bigendian()
- local fp = io.open("/bin/sh")
- fp:seek("set", 5)
- local be = (fp:read(1):byte() ~= 1)
- fp:close()
- return be
+ return string.byte(string.dump(function() end), 7) == 0
end
--- Execute given commandline and gather stdout.
end
--- Execute given commandline and gather stdout.