summaryrefslogtreecommitdiffstats
path: root/usr.bin/tee
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>2012-02-11 16:34:03 +0000
committercracauer <cracauer@FreeBSD.org>2012-02-11 16:34:03 +0000
commit80e768e1e7361286ba663754d0865ac1273e5a75 (patch)
treed7b25b469145d484d22b3852068832bc0a15c9fa /usr.bin/tee
parent4658c8a871895ad35616e374872586507064af81 (diff)
downloadFreeBSD-src-80e768e1e7361286ba663754d0865ac1273e5a75.zip
FreeBSD-src-80e768e1e7361286ba663754d0865ac1273e5a75.tar.gz
Reverting last change r231449 (fix bin/164947) due to concerns voiced
on src-committers and the fact that I can only take care of this in a week.
Diffstat (limited to 'usr.bin/tee')
-rw-r--r--usr.bin/tee/tee.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/usr.bin/tee/tee.c b/usr.bin/tee/tee.c
index 61d7f76..6b5c00c 100644
--- a/usr.bin/tee/tee.c
+++ b/usr.bin/tee/tee.c
@@ -42,10 +42,8 @@ static const char rcsid[] =
#endif /* not lint */
#include <sys/types.h>
-#include <sys/select.h>
#include <sys/stat.h>
#include <err.h>
-#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
@@ -62,7 +60,6 @@ static LIST *head;
static void add(int, const char *);
static void usage(void);
-static void waitfor(int fd);
int
main(int argc, char *argv[])
@@ -109,14 +106,9 @@ main(int argc, char *argv[])
bp = buf;
do {
if ((wval = write(p->fd, bp, n)) == -1) {
- if (errno == EAGAIN) {
- waitfor(p->fd);
- wval = 0;
- } else {
- warn("%s", p->name);
- exitval = 1;
- break;
- }
+ warn("%s", p->name);
+ exitval = 1;
+ break;
}
bp += wval;
} while (n -= wval);
@@ -145,15 +137,3 @@ add(int fd, const char *name)
p->next = head;
head = p;
}
-
-/* Wait for the specified fd to be ready for writing */
-static void
-waitfor(int fd)
-{
- fd_set writefds;
-
- FD_ZERO(&writefds);
- FD_SET(fd, &writefds);
- if (select(fd + 1, NULL, &writefds, NULL, NULL) == -1)
- err(1, "select");
-}
OpenPOWER on IntegriCloud