mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-13 14:43:09 +00:00
non glibc need a true tms for times
This commit is contained in:
parent
851280af4f
commit
8b2e05a681
14
lsyncd.c
14
lsyncd.c
@ -130,6 +130,16 @@ sig_handler(int sig)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Non glibc builds need a real tms structure for times() call
|
||||||
|
*/
|
||||||
|
#ifdef __GLIBC__
|
||||||
|
static struct tms *dummy_tms = NULL;
|
||||||
|
#else
|
||||||
|
static struct tms _dummy_tms;
|
||||||
|
static struct tms *dummy_tms = &_dummy_tms;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Logging
|
* Logging
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -769,7 +779,7 @@ l_now(lua_State *L)
|
|||||||
clock_t *j = lua_newuserdata(L, sizeof(clock_t));
|
clock_t *j = lua_newuserdata(L, sizeof(clock_t));
|
||||||
luaL_getmetatable(L, "Lsyncd.jiffies");
|
luaL_getmetatable(L, "Lsyncd.jiffies");
|
||||||
lua_setmetatable(L, -2);
|
lua_setmetatable(L, -2);
|
||||||
*j = times(NULL);
|
*j = times(dummy_tms);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1476,7 +1486,7 @@ masterloop(lua_State *L)
|
|||||||
while(true) {
|
while(true) {
|
||||||
bool have_alarm;
|
bool have_alarm;
|
||||||
bool force_alarm;
|
bool force_alarm;
|
||||||
clock_t now = times(NULL);
|
clock_t now = times(dummy_tms);
|
||||||
clock_t alarm_time;
|
clock_t alarm_time;
|
||||||
|
|
||||||
/* queries runner about soonest alarm */
|
/* queries runner about soonest alarm */
|
||||||
|
Loading…
Reference in New Issue
Block a user