diff options
author | Vo Trung Chi <Chi.VoTrung@vn.bosch.com> | 2019-05-06 18:07:13 +0700 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2019-09-13 08:49:36 +0900 |
commit | 29d67662d14317aa03c444520936e701384733b9 (patch) | |
tree | 1aadf1ae021c8670adc43dc15c23fa6536ec54f1 /src | |
parent | 560e7c42975e2adb427642a49a180bc9f01f97d8 (diff) | |
download | DLT-daemon-29d67662d14317aa03c444520936e701384733b9.tar.gz |
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 <Chi.VoTrung@vn.bosch.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/dlt_user.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |