ok = (0 == skip_log);
skip_log = 0;
if (check_reset)
- GNUNET_assert (ok);
+ GNUNET_break (ok);
}
else
{
memset (date, 0, DATE_STR_SIZE);
{
char buf[size];
+ long long offset;
#ifdef WINDOWS
LARGE_INTEGER pc;
time_t timetmp;
+ offset = GNUNET_TIME_get_offset ();
time (&timetmp);
+ timetmp += offset / 1000;
tmptr = localtime (&timetmp);
pc.QuadPart = 0;
QueryPerformanceCounter (&pc);
struct timeval timeofday;
gettimeofday (&timeofday, NULL);
+ offset = GNUNET_TIME_get_offset ();
+ if (offset > 0)
+ {
+ timeofday.tv_sec += offset / 1000LL;
+ timeofday.tv_usec += (offset % 1000LL) * 1000LL;
+ if (timeofday.tv_usec > 1000000LL)
+ {
+ timeofday.tv_usec -= 1000000LL;
+ timeofday.tv_sec++;
+ }
+ }
+ else
+ {
+ timeofday.tv_sec += offset / 1000LL;
+ if (timeofday.tv_usec > - (offset % 1000LL) * 1000LL)
+ {
+ timeofday.tv_usec += (offset % 1000LL) * 1000LL;
+ }
+ else
+ {
+ timeofday.tv_usec += 1000000LL + (offset % 1000LL) * 1000LL;
+ timeofday.tv_sec--;
+ }
+ }
tmptr = localtime (&timeofday.tv_sec);
if (NULL == tmptr)
{
off = 0;
if (un->sun_path[0] == '\0')
off++;
- snprintf (buf, sizeof (buf), "%s%.*s", (off == 1) ? "@" : "",
+ memset (buf, 0, sizeof (buf));
+ snprintf (buf, sizeof (buf) - 1, "%s%.*s", (off == 1) ? "@" : "",
(int) (addrlen - sizeof (sa_family_t) - 1 - off),
&un->sun_path[off]);
return buf;
}
+/**
+ * Log error message about missing configuration option.
+ *
+ * @param kind log level
+ * @param section section with missing option
+ * @param option name of missing option
+ */
+void
+GNUNET_log_config_missing (enum GNUNET_ErrorType kind,
+ const char *section,
+ const char *option)
+{
+ GNUNET_log (kind,
+ _("Configuration fails to specify option `%s' in section `%s'!\n"),
+ option,
+ section);
+}
+
+
+/**
+ * Log error message about invalid configuration option value.
+ *
+ * @param kind log level
+ * @param section section with invalid option
+ * @param option name of invalid option
+ * @param required what is required that is invalid about the option
+ */
+void
+GNUNET_log_config_invalid (enum GNUNET_ErrorType kind,
+ const char *section,
+ const char *option,
+ const char *required)
+{
+ GNUNET_log (kind,
+ _("Configuration specifies invalid value for option `%s' in section `%s': %s\n"),
+ option, section, required);
+}
+
+
/**
* Initializer
*/