aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2015-09-14 17:21:14 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2015-09-14 17:21:14 +0200
commitb1ccee1269efe8d03dba39d7381470f6d034287b (patch)
treece5fa3cf7fe866e8f8ad53a1d65d6d3354b604c3
parentf8236cb3eda9153ffb24da9fc3a34b8b9fdf9723 (diff)
Fix warnings returning bad type.
With the conversion to the threaded function, the return type is expected to be a pointer to a value. Return NULL for the moment and let catch the errors later if needed. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--aep.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/aep.c b/aep.c
index 2a048aa..c8e19fb 100644
--- a/aep.c
+++ b/aep.c
@@ -710,7 +710,7 @@ static void *aep_capture_thread(void *data)
output = malloc(1024);
if (!output) {
fprintf(stderr, "Failed to allocate memory for output\n");
- return;
+ return NULL;
}
memset(&aep_dev, 0, sizeof(aep_dev));
@@ -719,7 +719,7 @@ static void *aep_capture_thread(void *data)
aep_dev.fd = open(aep_opt->probe[arg->index], O_RDWR);
if (aep_dev.fd < 0) {
fprintf(stderr, "Failed to open '%s': %m\n", aep_opt->probe[arg->index]);
- return 1;
+ return NULL;
}
aep_dev.index = arg->index;
@@ -731,22 +731,22 @@ static void *aep_capture_thread(void *data)
epfd = epoll_create(1);
if (epfd < 0) {
fprintf(stderr, "Failed to create poll fd: %m\n");
- return 1;
+ return NULL;
}
if (epoll_ctl(epfd, EPOLL_CTL_ADD, aep_dev.fd, &eevt) < 0) {
fprintf(stderr, "Failed to add fd to epoll: %m\n");
- return 1;
+ return NULL;
}
if (aep_config(aep_dev.fd)) {
fprintf(stderr, "Failed to configure probe\n");
- return 1;
+ return NULL;
}
if (aep_start(aep_dev.fd)) {
fprintf(stderr, "Failed to start probe\n");
- return 1;
+ return NULL;
}
signal(SIGINT, sighandler);
@@ -761,7 +761,7 @@ again:
if (errno == EINTR)
goto again;
fprintf(stderr, "Failed to epoll_wait: %m\n");
- return 2;
+ return NULL;
}
if (!(eevt.events & EPOLLIN))
@@ -772,7 +772,7 @@ again:
frame_read = aep_read_frame(dev, frame, nr_frame, buffer);
if (frame_read < 0) {
fprintf(stderr, "Failed to read frames\n");
- return 2;
+ return NULL;
}
for (i = 0; i < frame_read; i++, dev->total_frame++)