return ret;
}
-int error_printf_unless_qmp(const char *fmt, ...)
-{
- va_list ap;
- int ret;
-
- va_start(ap, fmt);
- ret = error_vprintf_unless_qmp(fmt, ap);
- va_end(ap);
- return ret;
-}
-
static Location std_loc = {
.kind = LOC_NONE
};
const char *const *argp;
if (!monitor_cur() && g_get_prgname()) {
- fprintf(stderr, "%s:", g_get_prgname());
+ error_printf("%s:", g_get_prgname());
sep = " ";
}
switch (cur_loc->kind) {
static char *
real_time_iso8601(void)
{
-#if GLIB_CHECK_VERSION(2, 62, 0)
- g_autoptr(GDateTime) dt = g_date_time_new_from_unix_utc(g_get_real_time());
+#if GLIB_CHECK_VERSION(2,62,0)
+ g_autoptr(GDateTime) dt = g_date_time_new_now_utc();
+ /* ignore deprecation warning, since GLIB_VERSION_MAX_ALLOWED is 2.56 */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
return g_date_time_format_iso8601(dt);
+#pragma GCC diagnostic pop
#else
GTimeVal tv;
g_get_current_time(&tv);
* a single phrase, with no newline or trailing punctuation.
* Prepend the current location and append a newline.
*/
+G_GNUC_PRINTF(2, 0)
static void vreport(report_type type, const char *fmt, va_list ap)
{
gchar *timestr;