Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/ntp/dist/ntpd setting USE_FORT=yes means that m...
details: https://anonhg.NetBSD.org/src/rev/f7d497fe08a5
branches: trunk
changeset: 762753:f7d497fe08a5
user: plunky <plunky%NetBSD.org@localhost>
date: Sun Feb 27 12:10:18 2011 +0000
description:
setting USE_FORT=yes means that memmove() becomes a macro, and the
#ifdef inside the macro arguments is undefined behaviour (pcc reports
a syntax error)
This was fixed upstream so change this to be the same as the 4.2.6p3
stable release of ntp (can't find an actual changelog entry that
describes this, so have included the memcpy change also - memmove
is not required here)
diffstat:
external/bsd/ntp/dist/ntpd/ntp_util.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diffs (40 lines):
diff -r 78a52c4f3652 -r f7d497fe08a5 external/bsd/ntp/dist/ntpd/ntp_util.c
--- a/external/bsd/ntp/dist/ntpd/ntp_util.c Sun Feb 27 11:32:12 2011 +0000
+++ b/external/bsd/ntp/dist/ntpd/ntp_util.c Sun Feb 27 12:10:18 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp_util.c,v 1.1.1.1 2009/12/13 16:55:42 kardel Exp $ */
+/* $NetBSD: ntp_util.c,v 1.2 2011/02/27 12:10:18 plunky Exp $ */
/*
* ntp_util.c - stuff I didn't have any other place for
@@ -358,6 +358,11 @@
int len;
char tbuf[80];
char str1[20], str2[20];
+#ifndef VMS
+ const char temp_ext[] = ".TEMP";
+#else
+ const char temp_ext[] = "-TEMP";
+#endif
/*
* Expand environment strings under Windows NT, since the
@@ -412,14 +417,10 @@
stats_temp_file = erealloc(stats_temp_file,
len + sizeof(".TEMP"));
- memmove(stats_drift_file, value, (unsigned)(len+1));
- memmove(stats_temp_file, value, (unsigned)len);
- memmove(stats_temp_file + len,
-#if !defined(VMS)
- ".TEMP", sizeof(".TEMP"));
-#else
- "-TEMP", sizeof("-TEMP"));
-#endif /* VMS */
+ memcpy(stats_drift_file, value, (unsigned)(len+1));
+ memcpy(stats_temp_file, value, (unsigned)len);
+ memcpy(stats_temp_file + len, temp_ext,
+ sizeof(temp_ext));
/*
* Open drift file and read frequency. If the file is
Home |
Main Index |
Thread Index |
Old Index