From 1e7d374593ae34c5f1b343a213123d5385852fe7 Mon Sep 17 00:00:00 2001 From: Dinh Cong Toan Date: Tue, 25 May 2021 16:28:21 +0700 Subject: 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 --- src/daemon/dlt_daemon_event_handler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/daemon/dlt_daemon_event_handler.c') 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) { -- cgit v1.2.1