summaryrefslogtreecommitdiff
path: root/src/lib/dlt_env_ll.c
diff options
context:
space:
mode:
authorSaya Sugiura <ssugiura@jp.adit-jv.com>2018-06-28 11:15:47 +0900
committerChristoph Lipka <clipka@users.noreply.github.com>2018-12-21 10:16:46 +0100
commit037d33d0c1bc83ca79812340ea9120d13fd1c705 (patch)
treebf51eabc6ae30e17ab650dbc4ecfb9127b4da6d8 /src/lib/dlt_env_ll.c
parent88b6b69f313f35267fb0bde533f8e1d2a742f771 (diff)
downloadDLT-daemon-037d33d0c1bc83ca79812340ea9120d13fd1c705.tar.gz
lib: socket: Flush all data before closing socket
Sometimes socket will be closed even not all of the data is flushed to daemon. So before closing, following will be handled: 1. Use shutdown() to shut down further transmissions 2. Subsequent read() to resend_buffer Also socket fd is reset in child fork handler since the socket itself will not be duplicated in the child process. Solves JIRA: SWGIII-28702 Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'src/lib/dlt_env_ll.c')
-rw-r--r--src/lib/dlt_env_ll.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/dlt_env_ll.c b/src/lib/dlt_env_ll.c
index a3e3a16..aeaa1d3 100644
--- a/src/lib/dlt_env_ll.c
+++ b/src/lib/dlt_env_ll.c
@@ -354,8 +354,11 @@ void dlt_env_free_ll_set(dlt_env_ll_set * const ll_set)
return;
}
- free(ll_set->item);
- ll_set->item = NULL;
+ if (!ll_set->item)
+ {
+ free(ll_set->item);
+ ll_set->item = NULL;
+ }
ll_set->array_size = 0u;
ll_set->num_elem = 0u;
}