Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-05-19 11:59:46 +0300
committerFelix Fietkau <nbd@nbd.name>2016-05-19 11:59:48 +0300
commit1257a38a6e64511207bb3b077ca7e8e1a3338fc1 (patch)
treecb7f94778e01cf4dda6f4b72f06d44150a2476d4 /uloop-epoll.c
parent93be9309b86d07eaa3b83ad07d380ca3092b29a1 (diff)
uloop: revert signalfd support for now
It hasn't fixed the reported race condition and it introduced some new issues. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'uloop-epoll.c')
-rw-r--r--uloop-epoll.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/uloop-epoll.c b/uloop-epoll.c
index 2d1c4a7..bb652fd 100644
--- a/uloop-epoll.c
+++ b/uloop-epoll.c
@@ -16,8 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/signalfd.h>
-
/**
* FIXME: uClibc < 0.9.30.3 does not define EPOLLRDHUP for Linux >= 2.6.17
*/
@@ -25,79 +23,8 @@
#define EPOLLRDHUP 0x2000
#endif
-static void
-uloop_signal_fd_cb(struct uloop_fd *fd, unsigned int events)
-{
- struct signalfd_siginfo fdsi;
- struct sigaction act;
- int ret;
-
-retry:
- ret = read(fd->fd, &fdsi, sizeof(fdsi));
- if (ret < 0 && errno == EINTR)
- goto retry;
-
- if (ret != sizeof(fdsi))
- return;
-
- switch (fdsi.ssi_signo) {
- case SIGQUIT:
- case SIGINT:
- case SIGTERM:
- sigaction(fdsi.ssi_signo, NULL, &act);
- if (act.sa_handler != SIG_IGN &&
- act.sa_handler != SIG_DFL) {
- act.sa_handler(fdsi.ssi_signo);
- break;
- }
-
- /* fall through */
- default:
- uloop_handle_signal(fdsi.ssi_signo);
- break;
- }
-}
-
-static bool
-uloop_setup_signalfd(bool add)
-{
- static struct uloop_fd sfd = {
- .cb = uloop_signal_fd_cb
- };
- static sigset_t prev_mask;
- sigset_t mask;
-
- if (signal_fd < 0)
- return false;
-
- sigemptyset(&mask);
-
- if (!add) {
- uloop_fd_delete(&sfd);
- sigprocmask(SIG_BLOCK, &prev_mask, NULL);
- } else {
- sigaddset(&mask, SIGQUIT);
- sigaddset(&mask, SIGINT);
- sigaddset(&mask, SIGTERM);
- sigaddset(&mask, SIGCHLD);
- sigprocmask(SIG_BLOCK, &mask, &prev_mask);
-
- sfd.fd = signal_fd;
- uloop_fd_add(&sfd, ULOOP_READ | ULOOP_EDGE_TRIGGER);
- }
-
- if (signalfd(signal_fd, &mask, SFD_NONBLOCK | SFD_CLOEXEC) < 0) {
- sigprocmask(SIG_BLOCK, &prev_mask, NULL);
- return false;
- }
-
- return true;
-}
-
int uloop_init(void)
{
- sigset_t mask;
-
if (poll_fd >= 0)
return 0;
@@ -106,10 +33,6 @@ int uloop_init(void)
return -1;
fcntl(poll_fd, F_SETFD, fcntl(poll_fd, F_GETFD) | FD_CLOEXEC);
-
- sigemptyset(&mask);
- signal_fd = signalfd(-1, &mask, SFD_NONBLOCK | SFD_CLOEXEC);
-
return 0;
}