Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dvblast
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
dvblast
Commits
32c854f8
Commit
32c854f8
authored
Aug 24, 2011
by
Georgi Chorbadzhiyski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install SIGINT handler to be able to break out of main loop.
parent
b76560f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
dvblast.c
dvblast.c
+12
-2
No files found.
dvblast.c
View file @
32c854f8
...
@@ -95,6 +95,7 @@ const char *psz_dvb_charset = "ISO_8859-1";
...
@@ -95,6 +95,7 @@ const char *psz_dvb_charset = "ISO_8859-1";
print_type_t
i_print_type
=
-
1
;
print_type_t
i_print_type
=
-
1
;
volatile
sig_atomic_t
b_hup_received
=
0
;
volatile
sig_atomic_t
b_hup_received
=
0
;
volatile
sig_atomic_t
b_exit_now
=
0
;
int
i_verbose
=
DEFAULT_VERBOSITY
;
int
i_verbose
=
DEFAULT_VERBOSITY
;
int
i_syslog
=
0
;
int
i_syslog
=
0
;
...
@@ -388,7 +389,10 @@ static void config_ReadFile( char *psz_file )
...
@@ -388,7 +389,10 @@ static void config_ReadFile( char *psz_file )
*****************************************************************************/
*****************************************************************************/
static
void
SigHandler
(
int
i_signal
)
static
void
SigHandler
(
int
i_signal
)
{
{
b_hup_received
=
1
;
if
(
i_signal
==
SIGHUP
)
b_hup_received
=
1
;
if
(
i_signal
==
SIGINT
)
b_exit_now
=
1
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -896,7 +900,7 @@ int main( int i_argc, char **pp_argv )
...
@@ -896,7 +900,7 @@ int main( int i_argc, char **pp_argv )
sa
.
sa_handler
=
SigHandler
;
sa
.
sa_handler
=
SigHandler
;
sigfillset
(
&
set
);
sigfillset
(
&
set
);
if
(
sigaction
(
SIGHUP
,
&
sa
,
NULL
)
==
-
1
)
if
(
sigaction
(
SIGHUP
,
&
sa
,
NULL
)
==
-
1
||
sigaction
(
SIGINT
,
&
sa
,
NULL
)
==
-
1
)
{
{
msg_Err
(
NULL
,
"couldn't set signal handler: %s"
,
strerror
(
errno
)
);
msg_Err
(
NULL
,
"couldn't set signal handler: %s"
,
strerror
(
errno
)
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
@@ -930,6 +934,12 @@ int main( int i_argc, char **pp_argv )
...
@@ -930,6 +934,12 @@ int main( int i_argc, char **pp_argv )
{
{
block_t
*
p_ts
;
block_t
*
p_ts
;
if
(
b_exit_now
)
{
msg_Info
(
NULL
,
"Shutdown was requested."
);
break
;
}
if
(
b_hup_received
)
if
(
b_hup_received
)
{
{
b_hup_received
=
0
;
b_hup_received
=
0
;
...
...
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