[vlc-devel] commit: Flawed logic ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Jan 18 09:43:57 CET 2009
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Jan 18 10:43:31 2009 +0200| [871a8bb5e18523acc703b97bae19c15a18487579] | committer: Rémi Denis-Courmont
Flawed logic
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=871a8bb5e18523acc703b97bae19c15a18487579
---
src/misc/objects.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/misc/objects.c b/src/misc/objects.c
index d72f8d8..29b9078 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -412,12 +412,14 @@ int vlc_object_waitpipe( vlc_object_t *obj )
assert (internals->pipes[1] == -1);
#ifdef HAVE_EVENTFD
- if ((internals->pipes[0] = internals->pipes[1] = eventfd (0, 0)) == -1)
+ if ((internals->pipes[0] = eventfd (0, 0)) == -1)
#endif
- if (pipe (internals->pipes))
- internals->pipes[0] = internals->pipes[1] = -1;
- else
- if (obj->b_die)
+ {
+ if (pipe (internals->pipes))
+ internals->pipes[0] = internals->pipes[1] = -1;
+ }
+
+ if (internals->pipes[0] != -1 && obj->b_die)
{ /* Race condition: vlc_object_kill() already invoked! */
msg_Dbg (obj, "waitpipe: object already dying");
write (internals->pipes[1], &(uint64_t){ 1 }, sizeof (uint64_t));
More information about the vlc-devel
mailing list