Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
521f9682
Commit
521f9682
authored
Jan 30, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Work around QProcess bug (KDE bug #260719)"
This reverts commit
ac11f9c0
.
parent
940ff812
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
29 deletions
+20
-29
NEWS
NEWS
+0
-3
bin/vlc.c
bin/vlc.c
+20
-26
No files found.
NEWS
View file @
521f9682
...
@@ -6,9 +6,6 @@ Changes between 1.1.6 and 1.1.7-git:
...
@@ -6,9 +6,6 @@ Changes between 1.1.6 and 1.1.7-git:
Changes between 1.1.6 and 1.1.6.1:
Changes between 1.1.6 and 1.1.6.1:
----------------------------------
----------------------------------
Interfaces:
* KDE: work around file dialog freeze due to KMimeTypeRepository and QProcess
Source:
Source:
* Fix libnotify, lirc, pulse building and packaging for Unix/Linux
* Fix libnotify, lirc, pulse building and packaging for Unix/Linux
...
...
bin/vlc.c
View file @
521f9682
...
@@ -63,11 +63,12 @@ static void dummy_handler (int signum)
...
@@ -63,11 +63,12 @@ static void dummy_handler (int signum)
int
main
(
int
i_argc
,
const
char
*
ppsz_argv
[]
)
int
main
(
int
i_argc
,
const
char
*
ppsz_argv
[]
)
{
{
/* The so-called POSIX-compliant MacOS X reportedly processes SIGPIPE even
/* The so-called POSIX-compliant MacOS X reportedly processes SIGPIPE even
* if it is blocked in all thread.
* if it is blocked in all thread. Also some libraries want SIGPIPE blocked
* as they have no clue about signal masks.
* Note: this is NOT an excuse for not protecting against SIGPIPE. If
* Note: this is NOT an excuse for not protecting against SIGPIPE. If
* LibVLC runs outside of VLC, we cannot rely on this code snippet. */
* LibVLC runs outside of VLC, we cannot rely on this code snippet. */
signal
(
SIGPIPE
,
SIG_IGN
);
signal
(
SIGPIPE
,
SIG_IGN
);
/* Restore
SIGCHLD in case our parent process
ignores it. */
/* Restore
default for SIGCHLD in case parent
ignores it. */
signal
(
SIGCHLD
,
SIG_DFL
);
signal
(
SIGCHLD
,
SIG_DFL
);
#ifdef HAVE_SETENV
#ifdef HAVE_SETENV
...
@@ -104,38 +105,31 @@ int main( int i_argc, const char *ppsz_argv[] )
...
@@ -104,38 +105,31 @@ int main( int i_argc, const char *ppsz_argv[] )
libvlc_get_version
(),
libvlc_get_changeset
()
);
libvlc_get_version
(),
libvlc_get_changeset
()
);
#endif
#endif
/* VLC uses sigwait() to dequeue interesting signals.
/* Synchronously intercepted POSIX signals.
* For this to work, those signals must be blocked in all threads,
* including the thread calling sigwait() (see the man page for details).
*
*
* There are two advantages to sigwait() over traditional signal handlers:
* In a threaded program such as VLC, the only sane way to handle signals
* - delivery is synchronous: no need to worry about async-safety,
* is to block them in all threads but one - this is the only way to
* - EINTR is not generated: other threads need not handle that error.
* predict which thread will receive them. If any piece of code depends
* That being said, some LibVLC programs do not use sigwait(). Therefore
* on delivery of one of this signal it is intrinsically not thread-safe
* EINTR must still be handled cleanly, notably from poll() calls.
* and MUST NOT be used in VLC, whether we like it or not.
* There is only one exception: if the signal is raised with
* pthread_kill() - we do not use this in LibVLC but some pthread
* implementations use them internally. You should really use conditions
* for thread synchronization anyway.
*
*
* Signal
s
that request a clean shutdown, and force an unclean shutdown
* Signal that request a clean shutdown, and force an unclean shutdown
* if they are triggered again 2+ seconds later.
* if they are triggered again 2+ seconds later.
* We have to handle SIGTERM cleanly because of daemon mode.
* We have to handle SIGTERM cleanly because of daemon mode.
* Note that we set the signals after the vlc_create call. */
* Note that we set the signals after the vlc_create call. */
static
const
int
sigs
[]
=
{
static
const
int
sigs
[]
=
{
SIGINT
,
SIGHUP
,
SIGQUIT
,
SIGTERM
,
SIGINT
,
SIGHUP
,
SIGQUIT
,
SIGTERM
,
/* SIGPIPE can happen and would crash the process. On modern systems,
/* Signals that cause a no-op:
* the MSG_NOSIGNAL flag protects socket write operations against SIGPIPE.
* - SIGPIPE might happen with sockets and would crash VLC. It MUST be
* But we still need to block SIGPIPE when:
* blocked by any LibVLC-dependent application, not just VLC.
* - writing to pipes,
* - SIGCHLD comes after exec*() (such as httpd CGI support) and must
* - using write() instead of send() for code not specific to sockets.
* be dequeued to cleanup zombie processes.
* LibVLC code assumes that SIGPIPE is blocked. Other LibVLC applications
* shall block it (or handle it somehow) too.
*/
*/
SIGPIPE
,
SIGPIPE
,
SIGCHLD
/* SIGCHLD must be dequeued to clean up zombie child processes.
* Furthermore the handler must not be set to SIG_IGN (see above). */
/* Unfortunately, the QProcess class from Qt4 has a bug. It installs a
* custom signal handlers and gets stuck if it is not called. So we cannot
* use sigwait() for SIGCHLD:
* http://bugs.kde.org/show_bug.cgi?id=260719 */
//SIGCHLD,
};
};
sigset_t
set
;
sigset_t
set
;
...
...
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