From: RĂ©mi Denis-Courmont Date: Sun, 11 Apr 2010 16:22:24 +0000 (+0300) Subject: VLC: remove false positives after fork() X-Git-Tag: 1.1.0-pre1~34 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=0194cf13b49fe6166152d427bcb06f5b25d197a6 VLC: remove false positives after fork() --- diff --git a/bin/override.c b/bin/override.c index c98ff81deb..c6084d88e4 100644 --- a/bin/override.c +++ b/bin/override.c @@ -26,13 +26,6 @@ void vlc_enable_override (void); -static bool override = false; - -void vlc_enable_override (void) -{ - override = true; -} - #if defined (__GNUC__) /* typeof and statement-expression */ \ && (defined (__ELF__) && !defined (__sun__)) /* Solaris crashes on printf("%s", NULL); which is legal, but annoying. */ @@ -46,6 +39,19 @@ void vlc_enable_override (void) # include #endif +static bool override = false; + +static void vlc_reset_override (void) +{ + override = false; +} + +void vlc_enable_override (void) +{ + override = true; + pthread_atfork (NULL, NULL, vlc_reset_override); +} + static void vlogbug (const char *level, const char *func, const char *fmt, va_list ap) { @@ -186,4 +192,8 @@ int sigaction (int signum, const struct sigaction *act, struct sigaction *old) } -#endif /* __ELF__ */ +#else +static void vlc_enable_override (void) +{ +} +#endif