diff options
author | Alexander Mohr <alexander.m.mohr@daimler.com> | 2020-12-16 17:27:58 +0100 |
---|---|---|
committer | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2021-01-06 09:11:21 +0900 |
commit | e7858cfa226f760b6f7ba9a43501ac071b2fd8a8 (patch) | |
tree | b035695899bd750af075ac2fd3d1112134e1b5bf /src/lib/dlt_user.c | |
parent | 6fade05719508d563c083c13e4c9e17257090526 (diff) | |
download | DLT-daemon-e7858cfa226f760b6f7ba9a43501ac071b2fd8a8.tar.gz |
dlt_user: fix invalid poll timeout
The poll timeout was only set for fifo.
TCP connections require this timeout as well.
dlt_user_log_check_user_message also validated the file descriptor
to be greater 0.
Because 0 is a valid file descriptor this check has been changed
to greater or equal 0.
poll receives a timeout in milliseconds.
The given paramter was in nanoseconds.
An additional define takes adds the delay in miliseconds.
Signed-off-by: Alexander Mohr <alexander.m.mohr@daimler.com>
Diffstat (limited to 'src/lib/dlt_user.c')
-rw-r--r-- | src/lib/dlt_user.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index ccebd4f..ec05cd2 100644 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -4242,13 +4242,8 @@ DltReturnValue dlt_user_log_check_user_message(void) nfd[0].events = POLLIN; nfd[0].fd = fd; -#if defined DLT_LIB_USE_UNIX_SOCKET_IPC || defined DLT_LIB_USE_VSOCK_IPC - if (fd != DLT_FD_INIT) { - ret = poll(nfd, 1, -1); -#else /* DLT_LIB_USE_FIFO_IPC */ - if (fd != DLT_FD_INIT && dlt_user.dlt_log_handle > 0) { - ret = poll(nfd, 1, DLT_USER_RECEIVE_NDELAY); -#endif + if (fd >= 0) { + 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; |