summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_event_handler.c
diff options
context:
space:
mode:
authorDinh Cong Toan <toan.dinhcong@vn.bosch.com>2021-05-25 16:28:21 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-06-30 10:54:59 +0900
commit1e7d374593ae34c5f1b343a213123d5385852fe7 (patch)
tree8df78ee5c1112874dc0d4d7c682ff559cbc2d04f /src/daemon/dlt_daemon_event_handler.c
parent3bb7eb24092ff771ccfd1119f8c1088f3f78f981 (diff)
downloadDLT-daemon-1e7d374593ae34c5f1b343a213123d5385852fe7.tar.gz
dlt message header broken
This commit is to revert the following commits: - de4a4234 - fb9ff078 - db9917b3 - e4467f0e - a567e01d Those commits are from improvement but they seem to break the dlt message header in some cases. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
Diffstat (limited to 'src/daemon/dlt_daemon_event_handler.c')
-rw-r--r--src/daemon/dlt_daemon_event_handler.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/daemon/dlt_daemon_event_handler.c b/src/daemon/dlt_daemon_event_handler.c
index 3cecf64..0d463da 100644
--- a/src/daemon/dlt_daemon_event_handler.c
+++ b/src/daemon/dlt_daemon_event_handler.c
@@ -109,9 +109,9 @@ int dlt_daemon_prepare_event_handling(DltEventHandler *ev)
static void dlt_event_handler_enable_fd(DltEventHandler *ev, int fd, int mask)
{
if (ev->max_nfds <= ev->nfds) {
- int i = (int) ev->nfds;
- int max = (int) (2 * ev->max_nfds);
- struct pollfd *tmp = realloc(ev->pfd, (size_t) (max) * sizeof(*ev->pfd));
+ int i = ev->nfds;
+ int max = 2 * ev->max_nfds;
+ struct pollfd *tmp = realloc(ev->pfd, max * sizeof(*ev->pfd));
if (!tmp) {
dlt_log(LOG_CRIT,
@@ -143,7 +143,7 @@ static void dlt_event_handler_disable_fd(DltEventHandler *ev, int fd)
{
unsigned int i = 0;
unsigned int j = 0;
- unsigned int nfds = (unsigned int) ev->nfds;
+ unsigned int nfds = ev->nfds;
for (; i < nfds; i++, j++) {
if (ev->pfd[i].fd == fd) {