[vlc-commits] messages: remove redundant cancellation handling
Rémi Denis-Courmont
git at videolan.org
Mon Apr 20 17:12:14 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Apr 20 18:08:40 2015 +0300| [f2c0c9a5d349d2d5d37a7e93588708d18a44cd80] | committer: Rémi Denis-Courmont
messages: remove redundant cancellation handling
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f2c0c9a5d349d2d5d37a7e93588708d18a44cd80
---
modules/logger/android.c | 3 ---
modules/logger/console.c | 8 --------
modules/logger/file.c | 8 --------
modules/logger/journal.c | 3 ---
modules/logger/syslog.c | 3 ---
src/misc/messages.c | 2 --
6 files changed, 27 deletions(-)
diff --git a/modules/logger/android.c b/modules/logger/android.c
index a89eb86..909621d 100644
--- a/modules/logger/android.c
+++ b/modules/logger/android.c
@@ -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)
diff --git a/modules/logger/console.c b/modules/logger/console.c
index 45a8932..ce2ab82 100644
--- a/modules/logger/console.c
+++ b/modules/logger/console.c
@@ -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)
diff --git a/modules/logger/file.c b/modules/logger/file.c
index e95790a..dfb0113 100644
--- a/modules/logger/file.c
+++ b/modules/logger/file.c
@@ -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)
diff --git a/modules/logger/journal.c b/modules/logger/journal.c
index 8fc7cc5..0bddfd6 100644
--- a/modules/logger/journal.c
+++ b/modules/logger/journal.c
@@ -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;
diff --git a/modules/logger/syslog.c b/modules/logger/syslog.c
index 349e257..fcb408b 100644
--- a/modules/logger/syslog.c
+++ b/modules/logger/syslog.c
@@ -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);
diff --git a/src/misc/messages.c b/src/misc/messages.c
index 651c295..8cbb7f1 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -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);
More information about the vlc-commits
mailing list