1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-02 04:55:23 -05:00
sdrangel/dsd/dsd_cleanupexit.c

36 lines
1.2 KiB
C

/*
* Copyright (C) 2010 DSD Author
* GPG Key ID: 0x3F1D7FD0 (74EF 430D F7F2 0A48 FCE6 F630 FAA2 635D 3F1D 7FD0)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <pthread.h>
#include "dsd_cleanupexit.h"
#include "dsd_nocarrier.h"
#include "dsd.h"
void cleanupAndExit(dsd_opts * opts, dsd_state * state)
{
noCarrier(opts, state);
#ifdef USE_LIBSNDFILE
if (opts->wav_out_f != NULL)
{
closeWavOutFile (opts, state);
}
#endif
fprintf(stderr, "dsd::cleanupAndExit: Exiting.\n");
int rc = 0;
pthread_exit(&rc);
}