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