From 155ebe4b5719f40b3feaf9fd8ff892cc10ad0e78 Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Sat, 23 Feb 2019 18:58:48 +0530 Subject: socket: socket event handlers now return void Problem: Returning any value from socket event handlers to the event sub-system doesn't make sense since event sub-system cannot handle socket sub-system errors. Solution: Change return type of all socket event handlers to 'void' mainline: > Reviewed-on: https://review.gluster.org/c/glusterfs/+/22221 Change-Id: I70dc2c57f12b7ea2fae41120f71aa0d7fe0b2b6f Fixes: bz#1651246 Signed-off-by: Milind Changire (cherry picked from commit 776ba851c6ee6c265253d44cf1d6e4e3d4a21772) --- libglusterfs/src/event-poll.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libglusterfs/src/event-poll.c') diff --git a/libglusterfs/src/event-poll.c b/libglusterfs/src/event-poll.c index 727d2a000a2..8ccd1f7f600 100644 --- a/libglusterfs/src/event-poll.c +++ b/libglusterfs/src/event-poll.c @@ -35,7 +35,7 @@ event_register_poll(struct event_pool *event_pool, int fd, event_handler_t handler, void *data, int poll_in, int poll_out); -static int +static void __flush_fd(int fd, int idx, int gen, void *data, int poll_in, int poll_out, int poll_err) { @@ -43,7 +43,7 @@ __flush_fd(int fd, int idx, int gen, void *data, int poll_in, int poll_out, int ret = -1; if (!poll_in) - return ret; + return; do { ret = sys_read(fd, buf, 64); @@ -55,7 +55,7 @@ __flush_fd(int fd, int idx, int gen, void *data, int poll_in, int poll_out, } } while (ret == 64); - return ret; + return; } static int @@ -375,10 +375,10 @@ unlock: pthread_mutex_unlock(&event_pool->mutex); if (handler) - ret = handler(ufds[i].fd, idx, 0, data, - (ufds[i].revents & (POLLIN | POLLPRI)), - (ufds[i].revents & (POLLOUT)), - (ufds[i].revents & (POLLERR | POLLHUP | POLLNVAL))); + handler(ufds[i].fd, idx, 0, data, + (ufds[i].revents & (POLLIN | POLLPRI)), + (ufds[i].revents & (POLLOUT)), + (ufds[i].revents & (POLLERR | POLLHUP | POLLNVAL))); return ret; } -- cgit