You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.8 KiB

  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. This explicitly casts to long long, as in #78, which may or may not
  6. be desired globally. It's certainly required in OpenWrt with musl 1.2+
  7. See also: https://github.com/pagekite/libpagekite/pull/78
  8. Fixes: e8cfa5f (incomplete)
  9. Signed-off-by: Karl Palsson <karlp@etactica.com>
  10. ---
  11. contrib/backends/pagekitec.c | 6 +++---
  12. 1 file changed, 3 insertions(+), 3 deletions(-)
  13. diff --git a/contrib/backends/pagekitec.c b/contrib/backends/pagekitec.c
  14. index ce39e30..76a78ac 100644
  15. --- a/contrib/backends/pagekitec.c
  16. +++ b/contrib/backends/pagekitec.c
  17. @@ -54,7 +54,7 @@ Note: For alternate license terms, see the file COPYING.md.
  18. " \"pagekitec_status_code\": %d,\n" \
  19. " \"pagekitec_pid\": %d,\n" \
  20. " \"pagekitec_update_min_interval\": %d,\n" \
  21. - " \"pagekitec_update_ts\": %ld\n" \
  22. + " \"pagekitec_update_ts\": %lld\n" \
  23. "}\n")
  24. /* Enable this format using -Y text:/path/to/file/ */
  25. @@ -64,7 +64,7 @@ Note: For alternate license terms, see the file COPYING.md.
  26. "pagekitec_status_code: %d\n" \
  27. "pagekitec_pid: %d\n" \
  28. "pagekitec_update_min_interval: %d\n" \
  29. - "pagekitec_update_ts: %ld\n")
  30. + "pagekitec_update_ts: %lld\n")
  31. pagekite_mgr m;
  32. @@ -153,7 +153,7 @@ int summarize_status(const char* fpath, const char* format, const char *status_m
  33. }
  34. fprintf(fd, format,
  35. - PK_VERSION, status_msg, status, getpid(), STATUS_MIN_INTERVAL, now);
  36. + PK_VERSION, status_msg, status, getpid(), STATUS_MIN_INTERVAL, (long long)now);
  37. if (0 == ftruncate(fileno(fd), ftell(fd))) fflush(fd);
  38. fclose(fd);
  39. --
  40. 2.37.3