acpid: update to 2.0.28
[feed/packages.git] / net / haproxy / patches / 0009-BUILD-lua-replace-timegm-with-my_timegm-to-fix-build.patch
1 From df1655a6c0e4431317cc66c67693281092a952b0 Mon Sep 17 00:00:00 2001
2 From: Willy Tarreau <w@1wt.eu>
3 Date: Wed, 19 Jul 2017 19:08:48 +0200
4 Subject: [PATCH 09/18] BUILD: lua: replace timegm() with my_timegm() to fix
5 build on Solaris 10
6
7 Akhnin Nikita reported that Lua doesn't build on Solaris 10 because
8 the code uses timegm() to parse a date, which is not provided there.
9 The recommended way to implement timegm() is broken in the man page,
10 as it is based on a change of the TZ environment variable at run time
11 before calling the function (which is obviously not thread safe, and
12 terribly inefficient).
13
14 Here instead we rely on the new my_timegm() function, it should be
15 sufficient for all known use cases.
16 (cherry picked from commit abd9bb20b76818c9f461a82b72b10818736ff8b3)
17
18 Signed-off-by: Willy Tarreau <w@1wt.eu>
19 ---
20 src/hlua_fcn.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23 diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
24 index 58905d7d..fe899a4a 100644
25 --- a/src/hlua_fcn.c
26 +++ b/src/hlua_fcn.c
27 @@ -287,7 +287,7 @@ static int hlua_parse_date(lua_State *L, int (*fcn)(const char *, int, struct tm
28 * the timezone from the broken-down time, it must be fixed
29 * after the conversion.
30 */
31 - time = timegm(&tm);
32 + time = my_timegm(&tm);
33 if (time == -1) {
34 lua_pushnil(L);
35 return 1;
36 --
37 2.13.0
38