summaryrefslogtreecommitdiffstats
path: root/buffer-poll.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 16:22:36 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 16:22:36 +0000
commit3eb1bfddd4dca10304501a540b20439eaf65fb4a (patch)
tree45a5c108dae605d85a1fcb442c2f4be057e64125 /buffer-poll.c
parenta5830b96033a65d88bcad83596cbe8600098b048 (diff)
Sync this properly.
Diffstat (limited to 'buffer-poll.c')
-rw-r--r--buffer-poll.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/buffer-poll.c b/buffer-poll.c
index 7015f3c6..566f2a01 100644
--- a/buffer-poll.c
+++ b/buffer-poll.c
@@ -1,4 +1,4 @@
-/* $Id: buffer-poll.c,v 1.13 2009-06-25 16:21:32 nicm Exp $ */
+/* $Id: buffer-poll.c,v 1.14 2009-06-25 16:22:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -23,29 +23,12 @@
#include "tmux.h"
-/* Set up pollfd for buffers. */
-void
-buffer_set(
- struct pollfd *pfd, int fd, unused struct buffer *in, struct buffer *out)
-{
- pfd->fd = fd;
- pfd->events = POLLIN;
- if (BUFFER_USED(out) > 0)
- pfd->events |= POLLOUT;
-}
-
/* Fill buffers from socket based on poll results. */
int
buffer_poll(struct pollfd *pfd, struct buffer *in, struct buffer *out)
{
ssize_t n;
-#if 0
- log_debug("buffer_poll (%ld): fd=%d, revents=%d; out=%zu in=%zu",
- (long) getpid(),
- pfd->fd, pfd->revents, BUFFER_USED(out), BUFFER_USED(in));
-#endif
-
#ifdef HAVE_POLL
if (pfd->revents & (POLLERR|POLLNVAL|POLLHUP))
return (-1);
@@ -53,9 +36,6 @@ buffer_poll(struct pollfd *pfd, struct buffer *in, struct buffer *out)
if (pfd->revents & POLLIN) {
buffer_ensure(in, BUFSIZ);
n = read(pfd->fd, BUFFER_IN(in), BUFFER_FREE(in));
-#if 0
- log_debug("buffer_poll: fd=%d, read=%zd", pfd->fd, n);
-#endif
if (n == 0)
return (-1);
if (n == -1) {