aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/tee.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix/tee.c')
-rw-r--r--toys/posix/tee.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/toys/posix/tee.c b/toys/posix/tee.c
index 15a40fe7..e6342f4c 100644
--- a/toys/posix/tee.c
+++ b/toys/posix/tee.c
@@ -21,14 +21,13 @@ config TEE
-i ignore SIGINT.
*/
+#define FOR_tee
#include "toys.h"
-DEFINE_GLOBALS(
+GLOBALS(
void *outputs;
)
-#define TT this.tee
-
struct fd_list {
struct fd_list *next;
int fd;
@@ -48,12 +47,12 @@ static void do_tee_open(int fd, char *name)
void tee_main(void)
{
- if (toys.optflags&2) signal(SIGINT, SIG_IGN);
+ if (toys.optflags & FLAG_i) signal(SIGINT, SIG_IGN);
// Open output files
loopfiles_rw(toys.optargs,
- O_RDWR|O_CREAT|((toys.optflags&1)?O_APPEND:O_TRUNC), 0666, 0,
- do_tee_open);
+ O_RDWR|O_CREAT|((toys.optflags & FLAG_a)?O_APPEND:O_TRUNC),
+ 0666, 0, do_tee_open);
for (;;) {
struct fd_list *fdl;