From 29d67662d14317aa03c444520936e701384733b9 Mon Sep 17 00:00:00 2001 From: Vo Trung Chi Date: Mon, 6 May 2019 18:07:13 +0700 Subject: network trace: Do not allow DLT usage in forked child dlt_user_trace_network_segmented() shall not be used in forked child process. Signed-off-by: Vo Trung Chi --- src/lib/dlt_user.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib') diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index 5a7294a..d67b005 100644 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -2958,6 +2958,10 @@ DltReturnValue dlt_user_trace_network_segmented(DltContext *handle, uint16_t payload_len, void *payload) { + /* forbid dlt usage in child after fork */ + if (g_dlt_is_child) + return DLT_RETURN_ERROR; + /* Send as normal trace if possible */ if (header_len + payload_len + sizeof(uint16_t) < dlt_user.log_buf_len) return dlt_user_trace_network(handle, nw_trace_type, header_len, header, payload_len, payload); -- cgit v1.2.1