Merge pull request #19372 from cotequeiroz/libgd
[feed/packages.git] / net / pagekitec / patches / 0002-pagekitec-status-files-correctly-support-64bit-time.patch
1 From 3dc6bd45838bb170ee4d95f014f0588c5d084d31 Mon Sep 17 00:00:00 2001
2 From: Karl Palsson <karlp@etactica.com>
3 Date: Mon, 19 Sep 2022 17:03:58 +0000
4 Subject: [PATCH 2/2] pagekitec: status files: correctly support 64bit time
5
6 This explicitly casts to long long, as in #78, which may or may not
7 be desired globally. It's certainly required in OpenWrt with musl 1.2+
8
9 See also: https://github.com/pagekite/libpagekite/pull/78
10
11 Fixes: e8cfa5f (incomplete)
12 Signed-off-by: Karl Palsson <karlp@etactica.com>
13 ---
14 contrib/backends/pagekitec.c | 6 +++---
15 1 file changed, 3 insertions(+), 3 deletions(-)
16
17 diff --git a/contrib/backends/pagekitec.c b/contrib/backends/pagekitec.c
18 index ce39e30..76a78ac 100644
19 --- a/contrib/backends/pagekitec.c
20 +++ b/contrib/backends/pagekitec.c
21 @@ -54,7 +54,7 @@ Note: For alternate license terms, see the file COPYING.md.
22 " \"pagekitec_status_code\": %d,\n" \
23 " \"pagekitec_pid\": %d,\n" \
24 " \"pagekitec_update_min_interval\": %d,\n" \
25 - " \"pagekitec_update_ts\": %ld\n" \
26 + " \"pagekitec_update_ts\": %lld\n" \
27 "}\n")
28
29 /* Enable this format using -Y text:/path/to/file/ */
30 @@ -64,7 +64,7 @@ Note: For alternate license terms, see the file COPYING.md.
31 "pagekitec_status_code: %d\n" \
32 "pagekitec_pid: %d\n" \
33 "pagekitec_update_min_interval: %d\n" \
34 - "pagekitec_update_ts: %ld\n")
35 + "pagekitec_update_ts: %lld\n")
36
37
38 pagekite_mgr m;
39 @@ -153,7 +153,7 @@ int summarize_status(const char* fpath, const char* format, const char *status_m
40 }
41
42 fprintf(fd, format,
43 - PK_VERSION, status_msg, status, getpid(), STATUS_MIN_INTERVAL, now);
44 + PK_VERSION, status_msg, status, getpid(), STATUS_MIN_INTERVAL, (long long)now);
45
46 if (0 == ftruncate(fileno(fd), ftell(fd))) fflush(fd);
47 fclose(fd);
48 --
49 2.37.3
50