Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug-Fix for invalid file descriptor validation and missing timeout in unix socket poll #281

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
dlt_user: changed poll timeout
 Changed the poll timeout to 500ms after
 performance measurements resulted this
 as a good compromise.
 Introduced a define which is used in poll.

Signed-off-by: Alexander Mohr <[email protected]>
Alexander Mohr committed Jan 3, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 4f506da087640f7539f17530461df0e25227eb4b
2 changes: 1 addition & 1 deletion src/lib/dlt_user.c
Original file line number Diff line number Diff line change
@@ -4243,7 +4243,7 @@ DltReturnValue dlt_user_log_check_user_message(void)
nfd[0].fd = fd;

if (fd >= 0) {
ret = poll(nfd, 1, 1000);
ret = poll(nfd, 1, DLT_USER_RECEIVE_MDELAY);
if (ret) {
if (nfd[0].revents & (POLLHUP | POLLNVAL | POLLERR)) {
dlt_user.dlt_log_handle = DLT_FD_INIT;
3 changes: 3 additions & 0 deletions src/lib/dlt_user_cfg.h
Original file line number Diff line number Diff line change
@@ -126,6 +126,9 @@
/* delay for housekeeper thread (nsec) while receiving messages*/
#define DLT_USER_RECEIVE_NDELAY (500 * 1000 * 1000)

/* timeout for poll operations in milliseconds*/
#define DLT_USER_RECEIVE_MDELAY (500)

/* Name of environment variable for local print mode */
#define DLT_USER_ENV_LOCAL_PRINT_MODE "DLT_LOCAL_PRINT_MODE"