aboutsummaryrefslogtreecommitdiff
path: root/network/sntpc/compilefix.diff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-01-26 15:33:58 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-01-30 08:36:00 +0700
commitd17bca972e018b295b8f887af0c3967ba99d4cf5 (patch)
treeebbe2f9db0d1046ede7433762faed3ba3b892f1d /network/sntpc/compilefix.diff
parentb5e76f14590bd2128436521f7c44a1100e6fb02a (diff)
network/sntpc: Added (simple NTP client).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/sntpc/compilefix.diff')
-rw-r--r--network/sntpc/compilefix.diff45
1 files changed, 45 insertions, 0 deletions
diff --git a/network/sntpc/compilefix.diff b/network/sntpc/compilefix.diff
new file mode 100644
index 0000000000000..e56b2a70a7edb
--- /dev/null
+++ b/network/sntpc/compilefix.diff
@@ -0,0 +1,45 @@
+diff -Naur sntpc-20181113_1ca1d00/sntpc.c sntpc-20181113_1ca1d00.patched/sntpc.c
+--- sntpc-20181113_1ca1d00/sntpc.c 2022-01-26 14:17:03.000000000 -0500
++++ sntpc-20181113_1ca1d00.patched/sntpc.c 2022-01-26 14:29:36.384241954 -0500
+@@ -7,9 +7,12 @@
+ #include <strings.h>
+ #include <sys/select.h>
+ #include <sys/socket.h>
++#include <time.h>
+ #include <sys/time.h>
+ #include <unistd.h>
+
++extern uint32_t arc4random(void);
++
+ #define SECONDS_1900_1970 (25567 * 86400U)
+
+ #pragma pack(1)
+@@ -56,10 +59,6 @@
+ errx(1, "Structure size mismatch (got %lu, expected 68)", sizeof(struct ntp_packet_t));
+ }
+
+- if (pledge("stdio inet dns settime", NULL) < 0) {
+- err(1, "pledge");
+- }
+-
+ int ch;
+ while ((ch = getopt(argc, argv, "bhnp:s:t:v")) != -1) {
+ switch (ch) {
+@@ -184,7 +183,7 @@
+
+ time_t local_now = time(NULL);
+ if (verbose) {
+- printf("sntpc: local clock %lld (%.24s)\n", local_now, ctime(&local_now));
++ printf("sntpc: local clock %ld (%.24s)\n", local_now, ctime(&local_now));
+ }
+ if (local_now > seconds_since_1970 && !backwards) {
+ errx(1, "not stepping clock backwards (use -b to allow this)");
+@@ -205,7 +204,7 @@
+ err(1, "settimeofday");
+ }
+ if (verbose) {
+- printf("sntpc: local clock set to %lld (%.24s)\n", new_clock.tv_sec, ctime(&new_clock.tv_sec));
++ printf("sntpc: local clock set to %ld (%.24s)\n", new_clock.tv_sec, ctime(&new_clock.tv_sec));
+ }
+ } else {
+ printf("sntpc: not setting clock because of -n\n");