Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Ezstream
Commits
057ef6a2
Commit
057ef6a2
authored
Feb 09, 2021
by
Moritz Grimm
Browse files
Clean up stream before exiting
Gentle reminder by AddressSanitizer.
parent
543b4d68
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ezstream.c
View file @
057ef6a2
...
...
@@ -748,8 +748,10 @@ main(int argc, char *argv[])
}
main_stream
=
stream_create
(
CFG_DEFAULT
);
if
(
0
>
stream_configure
(
main_stream
))
if
(
0
>
stream_configure
(
main_stream
))
{
stream_destroy
(
&
main_stream
);
return
(
ez_shutdown
(
1
));
}
cfg_server
=
stream_get_cfg_server
(
main_stream
);
cfg_stream
=
stream_get_cfg_stream
(
main_stream
);
cfg_intake
=
stream_get_cfg_intake
(
main_stream
);
...
...
@@ -762,6 +764,7 @@ main(int argc, char *argv[])
for
(
i
=
0
;
i
<
sizeof
(
ezstream_signals
)
/
sizeof
(
int
);
i
++
)
{
if
(
sigaction
(
ezstream_signals
[
i
],
&
act
,
NULL
)
==
-
1
)
{
log_syserr
(
ERROR
,
errno
,
"sigaction"
);
stream_destroy
(
&
main_stream
);
return
(
ez_shutdown
(
1
));
}
}
...
...
@@ -775,6 +778,7 @@ main(int argc, char *argv[])
act
.
sa_handler
=
SIG_IGN
;
if
(
sigaction
(
SIGPIPE
,
&
act
,
NULL
)
==
-
1
)
{
log_syserr
(
ERROR
,
errno
,
"sigaction"
);
stream_destroy
(
&
main_stream
);
return
(
ez_shutdown
(
1
));
}
...
...
@@ -783,6 +787,7 @@ main(int argc, char *argv[])
if
(
0
>
stream_connect
(
main_stream
))
{
log_error
(
"initial server connection failed"
);
stream_destroy
(
&
main_stream
);
return
(
ez_shutdown
(
1
));
}
log_notice
(
"connected: %s://%s:%u%s"
,
...
...
@@ -814,6 +819,7 @@ main(int argc, char *argv[])
}
while
(
cont
);
stream_disconnect
(
main_stream
);
stream_destroy
(
&
main_stream
);
if
(
quit
)
{
if
(
cfg_get_program_quiet_stderr
()
&&
...
...
Write
Preview
Supports
Markdown
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