glibc/glibc-nodate.patch

48 lines
1.5 KiB
Diff

Index: glibc-2.21/nscd/nscd_stat.c
===================================================================
--- glibc-2.21.orig/nscd/nscd_stat.c
+++ glibc-2.21/nscd/nscd_stat.c
@@ -36,8 +36,13 @@
#endif /* HAVE_SELINUX */
-/* We use this to make sure the receiver is the same. */
+/* We use this to make sure the receiver is the same. Capture mtime
+ of this file if possible. */
+#ifdef __TIMESTAMP__
+static const char compilation[21];
+#else
static const char compilation[21] = __DATE__ " " __TIME__;
+#endif
/* Statistic data for one database. */
struct dbstat
@@ -96,7 +101,12 @@ send_stats (int fd, struct database_dyn
memset (&data, 0, sizeof (data));
+#ifdef __TIMESTAMP__
+ /* Skip day of the week. */
+ memcpy (data.version, __TIMESTAMP__ + 4, sizeof (compilation));
+#else
memcpy (data.version, compilation, sizeof (compilation));
+#endif
data.debug_level = debug_level;
data.runtime = time (NULL) - start_time;
data.client_queued = client_queued;
@@ -196,7 +206,13 @@ receive_print_stats (void)
/* Read as much data as we expect. */
if (TEMP_FAILURE_RETRY (read (fd, &data, sizeof (data))) != sizeof (data)
- || (memcmp (data.version, compilation, sizeof (compilation)) != 0
+ || (
+#ifdef __TIMESTAMP__
+ /* Skip day of the week. */
+ memcmp (data.version, __TIMESTAMP__ + 4, sizeof (compilation)) != 0
+#else
+ memcmp (data.version, compilation, sizeof (compilation)) != 0
+#endif
/* Yes, this is an assignment! */
&& (errno = EINVAL)))
{