Browse Source

[core] remove fdevent fcntl_set hook

(could have been removed in 2010 with commit 38f2d1dd
 which removed fdevent_linux_rtsig.c)
personal/stbuehler/mod-csrf
Glenn Strauss 5 years ago
parent
commit
d4a37a3bbb
  1. 9
      src/fdevent.c
  2. 3
      src/fdevent.h
  3. 6
      src/gw_backend.c

9
src/fdevent.c

@ -301,15 +301,12 @@ void fdevent_clrfd_cloexec(int fd) {
#endif
}
int fdevent_fcntl_set(fdevents *ev, int fd) {
return ((ev) && (ev->fcntl_set)) ? ev->fcntl_set(ev, fd) : 0;
}
int fdevent_fcntl_set_nb(fdevents *ev, int fd) {
if ((ev) && (ev->fcntl_set)) return ev->fcntl_set(ev, fd);
UNUSED(ev);
#ifdef O_NONBLOCK
return fcntl(fd, F_SETFL, O_NONBLOCK | O_RDWR);
#else
UNUSED(fd);
return 0;
#endif
}
@ -322,7 +319,7 @@ int fdevent_fcntl_set_nb_cloexec(fdevents *ev, int fd) {
int fdevent_fcntl_set_nb_cloexec_sock(fdevents *ev, int fd) {
#if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
if (use_sock_cloexec)
return ((ev) && (ev->fcntl_set)) ? ev->fcntl_set(ev, fd) : 0;
return 0;
#endif
return fdevent_fcntl_set_nb_cloexec(ev, fd);
}

3
src/fdevent.h

@ -178,8 +178,6 @@ typedef struct fdevents {
int (*event_next_fdndx)(struct fdevents *ev, int ndx);
int (*poll)(struct fdevents *ev, int timeout_ms);
int (*fcntl_set)(struct fdevents *ev, int fd);
} fdevents;
fdevents *fdevent_init(struct server *srv, size_t maxfds, int type);
@ -208,7 +206,6 @@ void fdevent_sched_run(struct server *srv, fdevents *ev);
void fdevent_setfd_cloexec(int fd);
void fdevent_clrfd_cloexec(int fd);
int fdevent_fcntl_set(fdevents *ev, int fd);
int fdevent_fcntl_set_nb(fdevents *ev, int fd);
int fdevent_fcntl_set_nb_cloexec(fdevents *ev, int fd);
int fdevent_fcntl_set_nb_cloexec_sock(fdevents *ev, int fd);

6
src/gw_backend.c

@ -1722,12 +1722,6 @@ static handler_t gw_write_request(server *srv, gw_handler_ctx *hctx) {
fdevent_register(srv->ev, hctx->fd, gw_handle_fdevent, hctx);
if (-1 == fdevent_fcntl_set(srv->ev, hctx->fd)) {
log_error_write(srv, __FILE__, __LINE__, "ss",
"fcntl failed:", strerror(errno));
return HANDLER_ERROR;
}
if (hctx->proc->is_local) {
hctx->pid = hctx->proc->pid;
}

Loading…
Cancel
Save