From 575fc26bd70e976dba767fe929744587ab7a5e0d Mon Sep 17 00:00:00 2001 From: Unbit Date: Mon, 24 Jun 2013 16:01:43 +0200 Subject: [PATCH] try to support uclibc correctly --- core/spooler.c | 11 +++++++++++ plugins/lua/lua_plugin.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/core/spooler.c b/core/spooler.c index daabb06a..a7183cfd 100644 --- a/core/spooler.c +++ b/core/spooler.c @@ -241,6 +241,16 @@ int spool_request(struct uwsgi_spooler *uspool, char *filename, int rn, int core } if (at > 0) { +#ifdef __UCLIBC__ + struct timespec ts[2]; + ts[0].tv_sec = at; + ts[0].tv_nsec = 0; + ts[1].tv_sec = at; + ts[1].tv_nsec = 0; + if (futimens(fd, ts)) { + uwsgi_error("futimens()"); + } +#else struct timeval tv[2]; tv[0].tv_sec = at; tv[0].tv_usec = 0; @@ -253,6 +263,7 @@ int spool_request(struct uwsgi_spooler *uspool, char *filename, int rn, int core #endif uwsgi_error("futimes()"); } +#endif } // here the file will be unlocked too diff --git a/plugins/lua/lua_plugin.c b/plugins/lua/lua_plugin.c index b5a0a00e..e2c9dcc3 100644 --- a/plugins/lua/lua_plugin.c +++ b/plugins/lua/lua_plugin.c @@ -347,7 +347,7 @@ static int uwsgi_api_unlock(lua_State *L) { return 0; } -static const luaL_reg uwsgi_api[] = { +static const luaL_Reg uwsgi_api[] = { {"log", uwsgi_api_log}, {"connection_fd", uwsgi_api_req_fd},