Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
209c152e
Commit
209c152e
authored
Apr 11, 2010
by
Rémi Denis-Courmont
Browse files
Safety checks for X11 error handlers
parent
f3bef788
Changes
1
Show whitespace changes
Inline
Side-by-side
bin/override.c
View file @
209c152e
...
...
@@ -192,6 +192,43 @@ int sigaction (int signum, const struct sigaction *act, struct sigaction *old)
}
/*** Xlib ****/
#ifdef HAVE_X11_XLIB_H
# include <X11/Xlib.h>
static
pthread_mutex_t
xlib_lock
=
PTHREAD_MUTEX_INITIALIZER
;
int
(
*
XSetErrorHandler
(
int
(
*
handler
)
(
Display
*
,
XErrorEvent
*
)))
(
Display
*
,
XErrorEvent
*
)
{
if
(
override
)
{
int
(
*
ret
)
(
Display
*
,
XErrorEvent
*
);
pthread_mutex_lock
(
&
xlib_lock
);
LOG
(
"Error"
,
"%p"
,
handler
);
ret
=
CALL
(
XSetErrorHandler
,
handler
);
pthread_mutex_unlock
(
&
xlib_lock
);
return
ret
;
}
return
CALL
(
XSetErrorHandler
,
handler
);
}
int
(
*
XSetIOErrorHandler
(
int
(
*
handler
)
(
Display
*
)))
(
Display
*
)
{
if
(
override
)
{
int
(
*
ret
)
(
Display
*
);
pthread_mutex_lock
(
&
xlib_lock
);
LOG
(
"Error"
,
"%p"
,
handler
);
ret
=
CALL
(
XSetIOErrorHandler
,
handler
);
pthread_mutex_unlock
(
&
xlib_lock
);
return
ret
;
}
return
CALL
(
XSetIOErrorHandler
,
handler
);
}
#endif
#else
static
void
vlc_enable_override
(
void
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment