mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-01-14 04:07:19 +01:00
tell windows that ctrl-c was handled
Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
parent
0bc846c34c
commit
03f3504b41
15
src/main.c
15
src/main.c
@ -62,15 +62,24 @@ void usage(void)
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
BOOL WINAPI
|
BOOL WINAPI
|
||||||
#else
|
|
||||||
static void
|
|
||||||
#endif
|
|
||||||
sighandler(int signum)
|
sighandler(int signum)
|
||||||
|
{
|
||||||
|
if (CTRL_C_EVENT == signum) {
|
||||||
|
fprintf(stderr, "Signal caught, exiting!\n");
|
||||||
|
do_exit = 1;
|
||||||
|
rtlsdr_cancel_async(dev);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static void sighandler(int signum)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Signal caught, exiting!\n");
|
fprintf(stderr, "Signal caught, exiting!\n");
|
||||||
do_exit = 1;
|
do_exit = 1;
|
||||||
rtlsdr_cancel_async(dev);
|
rtlsdr_cancel_async(dev);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void rtlsdr_callback(unsigned char *buf, uint32_t len, void *ctx)
|
static void rtlsdr_callback(unsigned char *buf, uint32_t len, void *ctx)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user