From 619b6e04367dc6abbb317fd10d6e912ec677a0f5 Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Thu, 30 Dec 2010 23:34:01 +0100 Subject: [PATCH] openwrt: add 120-add_gettimeofday.patch to luci/patches --- .../luci/patches/120-add_gettimeofday.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 mote/v2/openwrt/package/luci/patches/120-add_gettimeofday.patch diff --git a/mote/v2/openwrt/package/luci/patches/120-add_gettimeofday.patch b/mote/v2/openwrt/package/luci/patches/120-add_gettimeofday.patch new file mode 100644 index 0000000..ea3ca74 --- /dev/null +++ b/mote/v2/openwrt/package/luci/patches/120-add_gettimeofday.patch @@ -0,0 +1,23 @@ +--- a/libs/nixio/src/poll.c (revision 4437) ++++ b/libs/nixio/src/poll.c (revision 6182) +@@ -22,4 +22,14 @@ + #include + #include ++#include ++ ++ ++static int nixio_gettimeofday(lua_State *L) { ++ struct timeval tv; ++ gettimeofday(&tv, NULL); ++ nixio__pushnumber(L, tv.tv_sec); ++ nixio__pushnumber(L, tv.tv_usec); ++ return 2; ++} + + +@@ -189,4 +199,5 @@ + /* module table */ + static const luaL_reg R[] = { ++ {"gettimeofday", nixio_gettimeofday}, + {"nanosleep", nixio_nanosleep}, + {"poll", nixio_poll},