demo: cross-link: Properly handle ioctl error
PATCH 1/1 demo: cross-link: Properly handle ioctl error
Update cross-link demo to properly report ioctl errors.
Signed-off-by Michael Welling <[email protected]>
--- demo/alchemy/cobalt/cross-link.c | 2 ++ 1 file changed, 2 insertions(+)
demo/alchemy/cobalt/cross-link.c +2 -0
@@ -23,6 +23,7 @@#include <stdio.h> #include <signal.h> #include <unistd.h> +#include <errno.h> #include <sys/mman.h> #include <alchemy/task.h> #include <alchemy/timer.h>
@@ -199,6 +200,7 @@ static void read_task_proc(void *arg)/* waiting for event */ err =ioctl (read_fd,RTSER_RTIOC_WAIT_EVENT , &rx_event);if (err) { + err = -errno;printf (RTASK_PREFIX "error on RTSER_RTIOC_WAIT_EVENT, %s\n" ,strerror (-err));
Signature · 1 line
2.1.4
Quoted 1 line · Michael Welling
Update cross-link demo to properly report ioctl errors.
This fixes only one spot. Are there no other spots with the same issue?
Signature · 2 lines
Gilles. https://click-hack.org
Quoted 4 lines · Gilles Chanteperdrix
Quoted 1 line · Michael Welling
Update cross-link demo to properly report ioctl errors.
This fixes only one spot. Are there no other spots with the same issue?
Oooops. Here come v2.
Quoted 4 lines
Signature · 3 lines
-- Gilles. https://click-hack.org