From: Alan T. DeKok Date: Mon, 28 Nov 2016 20:39:11 +0000 (-0500) Subject: 'read' and 'write' are NOT variable names X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=951d97fdbbd6dfecde094527210b3abbd2cdd38c;p=thirdparty%2Ffreeradius-server.git 'read' and 'write' are NOT variable names They are functions which are defined in Posix. --- diff --git a/src/include/event.h b/src/include/event.h index 5b896da9ed9..3fba3c44cec 100644 --- a/src/include/event.h +++ b/src/include/event.h @@ -85,8 +85,8 @@ int fr_event_list_time(struct timeval *when, fr_event_list_t *el); int fr_event_fd_delete(fr_event_list_t *el, int fd); int fr_event_fd_insert(fr_event_list_t *el, int fd, - fr_event_fd_handler_t read, - fr_event_fd_handler_t write, + fr_event_fd_handler_t read_fn, + fr_event_fd_handler_t write_fn, fr_event_fd_handler_t error, void *ctx); diff --git a/src/lib/event.c b/src/lib/event.c index 0cd4615d4a7..5e3a747dca0 100644 --- a/src/lib/event.c +++ b/src/lib/event.c @@ -275,8 +275,8 @@ static int _fr_event_fd_free(fr_event_fd_t *ef) * * @param[in] el to insert fd callback into. * @param[in] fd to read from. - * @param[in] read function to call when fd is readable. - * @param[in] write function to call when fd is writable. + * @param[in] read_fn function to call when fd is readable. + * @param[in] write_fn function to call when fd is writable. * @param[in] error function to call when an error occurs on the fd. * @param[in] ctx to pass to handler. * @return @@ -284,8 +284,8 @@ static int _fr_event_fd_free(fr_event_fd_t *ef) * - -1 on failure. */ int fr_event_fd_insert(fr_event_list_t *el, int fd, - fr_event_fd_handler_t read, - fr_event_fd_handler_t write, + fr_event_fd_handler_t read_fn, + fr_event_fd_handler_t write_fn, fr_event_fd_handler_t error, void *ctx) { @@ -299,7 +299,7 @@ int fr_event_fd_insert(fr_event_list_t *el, int fd, return -1; } - if (!read && !write) { + if (!read_fn && !write_fn) { fr_strerror_printf("Invalid arguments: NULL read and write callbacks"); return -1; } @@ -346,8 +346,8 @@ int fr_event_fd_insert(fr_event_list_t *el, int fd, } else { pre_existing = true; - if (ef->read && !read) filter |= EVFILT_READ; - if (ef->write && !write) filter |= EVFILT_WRITE; + if (ef->read && !read_fn) filter |= EVFILT_READ; + if (ef->write && !write_fn) filter |= EVFILT_WRITE; if (filter) { EV_SET(&evset, ef->fd, filter, EV_DELETE, 0, 0, 0); @@ -375,13 +375,13 @@ int fr_event_fd_insert(fr_event_list_t *el, int fd, ef->ctx = ctx; - if (read) { - ef->read = read; + if (read_fn) { + ef->read = read_fn; filter |= EVFILT_READ; } - if (write) { - ef->write = write; + if (write_fn) { + ef->write = write_fn; filter |= EVFILT_WRITE; } ef->error = error;