Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/ntp - enable PARSE clocks (missed config option...
details: https://anonhg.NetBSD.org/src/rev/cf812994b3dc
branches: trunk
changeset: 325752:cf812994b3dc
user: kardel <kardel%NetBSD.org@localhost>
date: Sun Jan 05 15:13:36 2014 +0000
description:
- enable PARSE clocks (missed config option when merging)
- remove all conflict markers/finish merge in refclock_parse.c:1.10
diffstat:
external/bsd/ntp/dist/ntpd/refclock_parse.c | 360 +---------------------------
external/bsd/ntp/include/config.h | 2 +-
2 files changed, 4 insertions(+), 358 deletions(-)
diffs (truncated from 809 to 300 lines):
diff -r fbbcfa2eff5e -r cf812994b3dc external/bsd/ntp/dist/ntpd/refclock_parse.c
--- a/external/bsd/ntp/dist/ntpd/refclock_parse.c Sun Jan 05 12:59:03 2014 +0000
+++ b/external/bsd/ntp/dist/ntpd/refclock_parse.c Sun Jan 05 15:13:36 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: refclock_parse.c,v 1.10 2013/12/28 03:20:14 christos Exp $ */
+/* $NetBSD: refclock_parse.c,v 1.11 2014/01/05 15:13:36 kardel Exp $ */
/*
* /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2543,74 +2543,37 @@
if (flagstrings[i].bit & lstate)
{
if (s != t)
-<<<<<<< refclock_parse.c
t = ap(buffer, size, t, "; ");
t = ap(buffer, size, t, "%s", flagstrings[i].name);
-=======
- strlcpy(t, "; ", BUFFER_SIZES(buffer, t, size));
- if (strlcat(t, flagstrings[i].name, BUFFER_SIZES(buffer, t, size)) <
- BUFFER_SIZES(buffer, t, size))
- t += strlen(t);
->>>>>>> 1.1.1.3
}
i++;
}
if (lstate & (PARSEB_S_LEAP|PARSEB_S_ANTENNA|PARSEB_S_PPS|PARSEB_S_POSITION))
{
-<<<<<<< refclock_parse.c
if (s != t)
t = ap(buffer, size, t, "; ");
t = ap(buffer, size, t, "(");
-=======
- if (s != t &&
- strlcpy(t, "; ", BUFFER_SIZES(buffer, t, size)) <
- BUFFER_SIZES(buffer, t, size))
- t += strlen(t);
->>>>>>> 1.1.1.3
-
-<<<<<<< refclock_parse.c
+
s = t;
-=======
- if (strlcpy(t, "(", BUFFER_SIZES(buffer, t, size)) <
- BUFFER_SIZES(buffer, t, size))
- s = t = t + strlen(t);
->>>>>>> 1.1.1.3
i = 0;
while (sflagstrings[i].bit)
{
if (sflagstrings[i].bit & lstate)
{
-<<<<<<< refclock_parse.c
if (t != s)
{
t = ap(buffer, size, t, "; ");
}
-=======
- if (t != s &&
- strlcpy(t, "; ", BUFFER_SIZES(buffer, t, size)) <
- BUFFER_SIZES(buffer, t, size))
- t += 2;
->>>>>>> 1.1.1.3
-<<<<<<< refclock_parse.c
t = ap(buffer, size, t, "%s",
sflagstrings[i].name);
-=======
- if (strlcpy(t, sflagstrings[i].name, BUFFER_SIZES(buffer, t, size)) <
- BUFFER_SIZES(buffer, t, size))
- t += strlen(t);
->>>>>>> 1.1.1.3
}
i++;
}
-<<<<<<< refclock_parse.c
t = ap(buffer, size, t, ")");
-=======
- strlcpy(t, ")", BUFFER_SIZES(buffer, t, size));
->>>>>>> 1.1.1.3
}
return buffer;
}
@@ -2651,15 +2614,9 @@
{
if (flagstrings[i].bit & lstate)
{
-<<<<<<< refclock_parse.c
if (t == buffer)
t = ap(buffer, size, t, "; ");
t = ap(buffer, size, t, "%s", flagstrings[i].name);
-=======
- if (buffer[0])
- strlcat(buffer, "; ", size);
- strlcat(buffer, flagstrings[i].name, size);
->>>>>>> 1.1.1.3
}
i++;
}
@@ -3307,18 +3264,9 @@
parse_shutdown(CLK_UNIT(parse->peer), peer); /* let our cleaning staff do the work */
return 0; /* well, ok - special initialisation broke */
}
-<<<<<<< refclock_parse.c
strlcpy(tmp_ctl.parseformat.parse_buffer, parse->parse_type->cl_format, sizeof(tmp_ctl.parseformat.parse_buffer));
tmp_ctl.parseformat.parse_count = strlen(tmp_ctl.parseformat.parse_buffer);
-=======
-
- tmp_ctl.parseformat.parse_count = strlcpy(tmp_ctl.parseformat.parse_buffer,
- parse->parse_type->cl_format,
- sizeof(tmp_ctl.parseformat.parse_buffer));
- if (tmp_ctl.parseformat.parse_count >= sizeof(tmp_ctl.parseformat.parse_buffer))
- tmp_ctl.parseformat.parse_count = sizeof(tmp_ctl.parseformat.parse_buffer) - 1;
->>>>>>> 1.1.1.3
if (!PARSE_SETFMT(parse, &tmp_ctl))
{
@@ -3605,11 +3553,7 @@
if (parse->timedata.parse_time.fp.l_ui == 0)
{
-<<<<<<< refclock_parse.c
tt = ap(start, 128, tt, "<UNDEFINED>\"");
-=======
- strlcpy(tt, "<UNDEFINED>\"", BUFFER_SIZES(start, tt, 128));
->>>>>>> 1.1.1.3
}
else
{
@@ -3637,11 +3581,7 @@
tt += strlen(tt);
-<<<<<<< refclock_parse.c
tt = ap(start, 512, tt, "\"");
-=======
- strlcat(tt, "\"", BUFFER_SIZES(start, tt, 512));
->>>>>>> 1.1.1.3
if (tmpctl.parsegettc.parse_count)
mkascii(outstatus+strlen(outstatus), (int)(sizeof(outstatus)- strlen(outstatus) - 1),
@@ -3670,12 +3610,7 @@
tmpctl.parseformat.parse_buffer);
}
-<<<<<<< refclock_parse.c
tt = ap(start, 80, tt, "\"");
-=======
- strlcat(tt, tmpctl.parseformat.parse_buffer, 80);
- strlcat(tt,"\"", 80);
->>>>>>> 1.1.1.3
}
/*
@@ -3683,12 +3618,7 @@
*/
start = tt = add_var(&out->kv_list, LEN_STATES, RO|DEF);
-<<<<<<< refclock_parse.c
tt = ap(start, LEN_STATES, tt, "refclock_states=\"");
-=======
- strlcpy(tt, "refclock_states=\"", LEN_STATES);
- tt += strlen(tt);
->>>>>>> 1.1.1.3
for (i = 0; i <= CEVNT_MAX; i++)
{
@@ -3722,13 +3652,8 @@
(int)(percent / 100), (int)(percent % 100));
if ((count = strlen(item)) < (LEN_STATES - 40 - (tt - start)))
{
-<<<<<<< refclock_parse.c
tt = ap(start, LEN_STATES, tt,
"%s", item);
-=======
- strlcpy(tt, item, BUFFER_SIZES(start, tt, LEN_STATES));
- tt += count;
->>>>>>> 1.1.1.3
}
sum += s_time;
}
@@ -4426,11 +4351,7 @@
p = ap(buffer, sizeof(buffer), p, ", ");
}
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer), p, "%s", (const char *)s->string);
-=======
- strlcat(p, (const char *)s->string, sizeof(buffer));
->>>>>>> 1.1.1.3
}
s++;
}
@@ -4438,11 +4359,7 @@
}
else
{
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer), p, "<OK>\"");
-=======
- strlcat(buffer, "<OK>\"", sizeof(buffer));
->>>>>>> 1.1.1.3
}
set_var(&parse->kv, buffer, strlen(buffer)+1, RO|DEF);
@@ -4501,22 +4418,13 @@
switch (antinfo.status)
{
case ANT_INVALID:
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer),
p, "<OK>");
-=======
- strlcat(p, "<OK>", BUFFER_SIZE(buffer, p));
- p += strlen(p);
->>>>>>> 1.1.1.3
break;
case ANT_DISCONN:
-<<<<<<< refclock_parse.c
q = ap(buffer, sizeof(buffer),
p, "DISCONNECTED since ");
-=======
- strlcat(p, "DISCONNECTED since ", BUFFER_SIZE(buffer, p));
->>>>>>> 1.1.1.3
NLOG(NLOG_CLOCKSTATUS)
ERR(ERR_BADSTATUS)
msyslog(LOG_ERR,"PARSE receiver #%d: ANTENNA FAILURE: %s",
@@ -4528,13 +4436,8 @@
break;
case ANT_RECONN:
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer),
p, "RECONNECTED on ");
-=======
- strlcat(p, "RECONNECTED on ", BUFFER_SIZE(buffer, p));
- p += strlen(p);
->>>>>>> 1.1.1.3
mbg_tm_str(&p, &antinfo.tm_reconn, BUFFER_SIZE(buffer, p));
p = ap(buffer, sizeof(buffer),
p, ", reconnect clockoffset %c%ld.%07ld s, disconnect time ",
@@ -4552,11 +4455,7 @@
break;
}
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer), p, "\"");
-=======
- strlcat(p, "\"", BUFFER_SIZE(buffer, p));
->>>>>>> 1.1.1.3
set_var(&parse->kv, buffer, sizeof(buffer), RO|DEF);
}
@@ -4577,58 +4476,28 @@
int i;
p = buffer;
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer),
p, "gps_tot_51=\"");
-=======
- strlcpy(buffer, "gps_tot_51=\"", BUFFER_SIZE(buffer, p));
- p += strlen(p);
->>>>>>> 1.1.1.3
mbg_tgps_str(&p, &cfgh.tot_51, BUFFER_SIZE(buffer, p));
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer),
p, "\"");
set_var(&parse->kv, buffer, sizeof(buffer), RO);
-=======
- strlcpy(p, "\"", BUFFER_SIZE(buffer, p));
- set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
->>>>>>> 1.1.1.3
p = buffer;
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer),
p, "gps_tot_63=\"");
-=======
- strlcpy(buffer, "gps_tot_63=\"", BUFFER_SIZE(buffer, p));
- p += strlen(p);
->>>>>>> 1.1.1.3
mbg_tgps_str(&p, &cfgh.tot_63, BUFFER_SIZE(buffer, p));
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer),
p, "\"");
set_var(&parse->kv, buffer, sizeof(buffer), RO);
-=======
- strlcpy(p, "\"", BUFFER_SIZE(buffer, p));
- set_var(&parse->kv, buffer, strlen(buffer)+1, RO);
->>>>>>> 1.1.1.3
p = buffer;
-<<<<<<< refclock_parse.c
p = ap(buffer, sizeof(buffer),
p, "gps_t0a=\"");
Home |
Main Index |
Thread Index |
Old Index