1 |
tove 08/04/24 06:58:40 |
2 |
|
3 |
Added: chrony-1.23-sources.diff |
4 |
Log: |
5 |
Make the sources command output properly signed numbers. |
6 |
(Portage version: 2.1.5_rc6) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 net-misc/chrony/files/chrony-1.23-sources.diff |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/chrony/files/chrony-1.23-sources.diff?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/chrony/files/chrony-1.23-sources.diff?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: chrony-1.23-sources.diff |
15 |
=================================================================== |
16 |
commit 2f2446c7dc074b2d1728a5e3f7a600c10cea2425 |
17 |
Author: Goswin Brederlow <brederlo@××××××××××××××××××××××××.de> |
18 |
Date: Sat Mar 29 20:49:59 2008 +0000 |
19 |
|
20 |
Fix for chronyc "sources" command on 64 bit machines |
21 |
|
22 |
(Taken from |
23 |
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348412 |
24 |
) |
25 |
|
26 |
Attached is a patchlet to make the "sources" command of chrony output properly |
27 |
signed numbers. The chronyd code (see e.g. ntp.h) properly uses int32_t and |
28 |
friends to get the right number of bits per datatype while client.c just uses |
29 |
short, int, long. But long will be 64 bit or 32 bit depending on the cpu. |
30 |
|
31 |
diff --git a/client.c b/client.c |
32 |
index b7e5bcb..85d6e84 100644 |
33 |
--- a/client.c |
34 |
+++ b/client.c |
35 |
@@ -45,6 +45,12 @@ |
36 |
#include <readline/history.h> |
37 |
#endif |
38 |
|
39 |
+#ifdef HAS_STDINT_H |
40 |
+#include <stdint.h> |
41 |
+#elif defined(HAS_INTTYPES_H) |
42 |
+#include <inttypes.h> |
43 |
+#endif |
44 |
+ |
45 |
/* ================================================== */ |
46 |
|
47 |
static int sock_fd; |
48 |
@@ -1383,16 +1389,16 @@ process_cmd_sources(char *line) |
49 |
int n_sources, i; |
50 |
int verbose = 0; |
51 |
|
52 |
- long orig_latest_meas, latest_meas, est_offset; |
53 |
- unsigned long ip_addr; |
54 |
- unsigned long latest_meas_err, est_offset_err; |
55 |
- unsigned long latest_meas_ago; |
56 |
- unsigned short poll, stratum; |
57 |
- unsigned short state, mode; |
58 |
+ int32_t orig_latest_meas, latest_meas, est_offset; |
59 |
+ uint32_t ip_addr; |
60 |
+ uint32_t latest_meas_err, est_offset_err; |
61 |
+ uint32_t latest_meas_ago; |
62 |
+ uint16_t poll, stratum; |
63 |
+ uint16_t state, mode; |
64 |
double resid_freq, resid_skew; |
65 |
const char *dns_lookup; |
66 |
char hostname_buf[32]; |
67 |
- unsigned short status; |
68 |
+ uint16_t status; |
69 |
|
70 |
/* Check whether to output verbose headers */ |
71 |
verbose = check_for_verbose_flag(line); |
72 |
|
73 |
|
74 |
|
75 |
-- |
76 |
gentoo-commits@l.g.o mailing list |