summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-02-09 13:16:55 +1100
committerJeremy Allison <jra@samba.org>2012-02-16 15:49:21 -0800
commit367c567c5f35db202474c8d3f730484538e1fb97 (patch)
tree6d4a05b6e2f2923fec8564d360eb7085a831d128 /source3/lib
parentab80995580f092811d6380caa9e71e4c5fda06f4 (diff)
downloadsamba-367c567c5f35db202474c8d3f730484538e1fb97.tar.gz
samba-367c567c5f35db202474c8d3f730484538e1fb97.tar.bz2
samba-367c567c5f35db202474c8d3f730484538e1fb97.zip
lib/util: Remove sys_poll as it is no longer needed
sys_poll() is only needed if the signal pipe is set up and used, but as no signal handler ever writes to the pipe, this can all be removed. signal based events are now handled via tevent. Andrew Bartlett Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/events.c11
-rw-r--r--source3/lib/g_lock.c12
-rw-r--r--source3/lib/util_sock.c4
3 files changed, 11 insertions, 16 deletions
diff --git a/source3/lib/events.c b/source3/lib/events.c
index 77589f8e7e..c71876ce39 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -101,14 +101,9 @@ bool event_add_to_poll_args(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
fds = *pfds;
num_pollfds = *pnum_pfds;
- /*
- * The +1 is for the sys_poll calling convention. It expects
- * an array 1 longer for the signal pipe
- */
-
- if (talloc_array_length(fds) < num_pollfds + num_fds + 1) {
+ if (talloc_array_length(fds) < num_pollfds + num_fds) {
fds = talloc_realloc(mem_ctx, fds, struct pollfd,
- num_pollfds + num_fds + 1);
+ num_pollfds + num_fds);
if (fds == NULL) {
DEBUG(10, ("talloc_realloc failed\n"));
return false;
@@ -338,7 +333,7 @@ static int s3_event_loop_once(struct tevent_context *ev, const char *location)
return -1;
}
- ret = sys_poll(state->pfds, num_pfds, timeout);
+ ret = poll(state->pfds, num_pfds, timeout);
if (ret == -1 && errno != EINTR) {
tevent_debug(ev, TEVENT_DEBUG_FATAL,
"poll() failed: %d:%s\n",
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 1fd8ae9f38..1011584a25 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -395,11 +395,11 @@ NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name,
*/
/*
- * We allocate 2 entries here. One is needed anyway for
- * sys_poll and in the clustering case we might have to add
- * the ctdb fd. This avoids the realloc then.
+ * We allocate 1 entries here. In the clustering case
+ * we might have to add the ctdb fd. This avoids the
+ * realloc then.
*/
- pollfds = talloc_array(talloc_tos(), struct pollfd, 2);
+ pollfds = talloc_array(talloc_tos(), struct pollfd, 1);
if (pollfds == NULL) {
status = NT_STATUS_NO_MEMORY;
break;
@@ -425,8 +425,8 @@ NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name,
select_timeout = timeval_min(&select_timeout,
&timeout_remaining);
- ret = sys_poll(pollfds, num_pollfds,
- timeval_to_msec(select_timeout));
+ ret = poll(pollfds, num_pollfds,
+ timeval_to_msec(select_timeout));
/*
* We're not *really interested in the actual flags. We just
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index dcc41bb699..69e33f7725 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1604,7 +1604,7 @@ int poll_one_fd(int fd, int events, int timeout, int *revents)
int ret;
int saved_errno;
- fds = talloc_zero_array(talloc_tos(), struct pollfd, 2);
+ fds = talloc_zero_array(talloc_tos(), struct pollfd, 1);
if (fds == NULL) {
errno = ENOMEM;
return -1;
@@ -1612,7 +1612,7 @@ int poll_one_fd(int fd, int events, int timeout, int *revents)
fds[0].fd = fd;
fds[0].events = events;
- ret = sys_poll(fds, 1, timeout);
+ ret = poll(fds, 1, timeout);
/*
* Assign whatever poll did, even in the ret<=0 case.