shutdown cleanups
now calls shairport_shutdown() when dying
This commit is contained in:
@@ -45,7 +45,7 @@ void die(char *format, ...) {
|
||||
va_start(args, format);
|
||||
vfprintf(stderr, format, args);
|
||||
va_end(args);
|
||||
exit(1);
|
||||
shairport_shutdown();
|
||||
}
|
||||
|
||||
void warn(char *format, ...) {
|
||||
|
||||
@@ -29,4 +29,6 @@ uint8_t *rsa_apply(uint8_t *input, int inlen, int *outlen, int mode);
|
||||
|
||||
extern shairport_cfg config;
|
||||
|
||||
void shairport_shutdown(void);
|
||||
|
||||
#endif // _COMMON_H
|
||||
|
||||
+3
-3
@@ -33,7 +33,7 @@
|
||||
#include "mdns.h"
|
||||
|
||||
static int shutting_down = 0;
|
||||
static void shutdown(void) {
|
||||
void shairport_shutdown(void) {
|
||||
if (shutting_down)
|
||||
return;
|
||||
shutting_down = 1;
|
||||
@@ -47,7 +47,7 @@ static void shutdown(void) {
|
||||
static void sig_ignore(int foo, siginfo_t *bar, void *baz) {
|
||||
}
|
||||
static void sig_shutdown(int foo, siginfo_t *bar, void *baz) {
|
||||
shutdown();
|
||||
shairport_shutdown();
|
||||
}
|
||||
|
||||
void usage(char *progname) {
|
||||
@@ -158,6 +158,6 @@ int main(int argc, char **argv) {
|
||||
rtsp_listen_loop();
|
||||
|
||||
// should not.
|
||||
shutdown();
|
||||
shairport_shutdown();
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user