diff options
-rw-r--r-- | src/console/dlt-control-common.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/console/dlt-control-common.c b/src/console/dlt-control-common.c index 96a15a2..abcaf92 100644 --- a/src/console/dlt-control-common.c +++ b/src/console/dlt-control-common.c @@ -630,6 +630,15 @@ int dlt_control_init(int (*response_analyzer)(char *, void *, int), */ int dlt_control_deinit(void) { + /* At this stage, we want to stop sending/receiving + * from dlt-daemon. So in order to avoid cancellation + * at recv(), shutdown and close the socket + */ + if (g_client.receiver.fd) { + shutdown(g_client.receiver.fd, SHUT_RDWR); + close(g_client.receiver.fd); + g_client.receiver.fd = -1; + } /* Stopping the listener thread */ pthread_cancel(daemon_connect_thread); pthread_join(daemon_connect_thread, NULL); |