Commit f2c0c9a5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

messages: remove redundant cancellation handling

parent fba2ed8a
......@@ -46,8 +46,6 @@ static void AndroidPrintMsg(void *opaque, int type, const vlc_log_t *p_item,
if (verbose < type)
return;
int canc = vlc_savecancel();
if (asprintf(&format2, "[%0*"PRIxPTR"] %s %s: %s",
ptr_width, p_item->i_object_id, p_item->psz_module,
p_item->psz_object_type, format) < 0)
......@@ -68,7 +66,6 @@ static void AndroidPrintMsg(void *opaque, int type, const vlc_log_t *p_item,
}
__android_log_vprint(prio, "VLC", format2, ap);
free(format2);
vlc_restorecancel(canc);
}
static vlc_log_cb Open(vlc_object_t *obj, void **sysp)
......
......@@ -52,8 +52,6 @@ static void LogConsoleColor(void *opaque, int type, const vlc_log_t *meta,
if (verbose < type)
return;
int canc = vlc_savecancel();
flockfile(stream);
fprintf(stream, "["GREEN"%0*"PRIxPTR GRAY"] ", ptr_width,
meta->i_object_id);
......@@ -64,8 +62,6 @@ static void LogConsoleColor(void *opaque, int type, const vlc_log_t *meta,
vfprintf(stream, format, ap);
fputs(GRAY"\n", stream);
funlockfile(stream);
vlc_restorecancel(canc);
}
#endif /* !_WIN32 */
......@@ -78,8 +74,6 @@ static void LogConsoleGray(void *opaque, int type, const vlc_log_t *meta,
if (verbose < type)
return;
int canc = vlc_savecancel();
flockfile(stream);
fprintf(stream, "[%0*"PRIxPTR"] ", ptr_width, meta->i_object_id);
if (meta->psz_header != NULL)
......@@ -89,8 +83,6 @@ static void LogConsoleGray(void *opaque, int type, const vlc_log_t *meta,
vfprintf(stream, format, ap);
putc_unlocked('\n', stream);
funlockfile(stream);
vlc_restorecancel(canc);
}
static vlc_log_cb Open(vlc_object_t *obj, void **sysp)
......
......@@ -58,15 +58,11 @@ static void LogText(void *opaque, int type, const vlc_log_t *meta,
if (sys->verbosity < type)
return;
int canc = vlc_savecancel();
flockfile(stream);
fprintf(stream, "%s%s: ", meta->psz_module, msg_type[type]);
vfprintf(stream, format, ap);
putc_unlocked('\n', stream);
funlockfile(stream);
vlc_restorecancel(canc);
}
#define HTML_FILENAME "vlc-log.html"
......@@ -100,8 +96,6 @@ static void LogHtml(void *opaque, int type, const vlc_log_t *meta,
if (sys->verbosity < type)
return;
int canc = vlc_savecancel();
flockfile(stream);
fprintf(stream, "%s%s: <span style=\"color: #%06x\">",
meta->psz_module, msg_type[type], color[type]);
......@@ -109,8 +103,6 @@ static void LogHtml(void *opaque, int type, const vlc_log_t *meta,
vfprintf(stream, format, ap);
fputs("</span>\n", stream);
funlockfile(stream);
vlc_restorecancel(canc);
}
static vlc_log_cb Open(vlc_object_t *obj, void **restrict sysp)
......
......@@ -42,7 +42,6 @@ static void Log(void *opaque, int type, const vlc_log_t *meta,
{
static const char default_msg[] = "message lost";
char *msg;
int canc = vlc_savecancel();
if (vasprintf(&msg, format, ap) == -1)
msg = (char *)default_msg;
......@@ -59,8 +58,6 @@ static void Log(void *opaque, int type, const vlc_log_t *meta,
"VLC_HEADER=%s", (meta->psz_header != NULL) ? meta->psz_header : "",
NULL);
vlc_restorecancel(canc);
if (msg != default_msg)
free(msg);
(void) opaque;
......
......@@ -44,8 +44,6 @@ static void Log(void *opaque, int type, const vlc_log_t *meta,
char *str;
int priority = priorities[type];
int canc = vlc_savecancel();
if (vasprintf(&str, format, ap) == -1)
str = (char *)default_msg;
......@@ -54,7 +52,6 @@ static void Log(void *opaque, int type, const vlc_log_t *meta,
str);
else
syslog(priority, "%s: %s", meta->psz_module, str);
vlc_restorecancel(canc);
if (str != default_msg)
free(str);
......
......@@ -239,10 +239,8 @@ static void vlc_vaLogEarly(void *d, int type, const vlc_log_t *item,
log->meta.line = item->line;
log->meta.func = item->func;
int canc = vlc_savecancel(); /* XXX: needed for vasprintf() ? */
if (vasprintf(&log->msg, format, ap) == -1)
log->msg = NULL;
vlc_restorecancel(canc);
vlc_mutex_lock(&sys->lock);
assert(sys->tailp != NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment