version 1.10, 2015/10/09 01:37:09 |
version 1.11, 2016/10/28 07:22:59 |
|
|
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <signal.h> |
|
|
#include <err.h> |
#include <errno.h> |
#include <errno.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#include <unistd.h> |
#include <signal.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
#include <locale.h> |
#include <unistd.h> |
#include <err.h> |
|
|
|
struct list { |
struct list { |
struct list *next; |
struct list *next; |
|
|
int append, ch, exitval; |
int append, ch, exitval; |
char buf[8192]; |
char buf[8192]; |
|
|
setlocale(LC_ALL, ""); |
|
|
|
if (pledge("stdio wpath cpath", NULL) == -1) |
if (pledge("stdio wpath cpath", NULL) == -1) |
err(1, "pledge"); |
err(1, "pledge"); |
|
|
|
|
case 'i': |
case 'i': |
(void)signal(SIGINT, SIG_IGN); |
(void)signal(SIGINT, SIG_IGN); |
break; |
break; |
case '?': |
|
default: |
default: |
(void)fprintf(stderr, "usage: tee [-ai] [file ...]\n"); |
(void)fprintf(stderr, "usage: tee [-ai] [file ...]\n"); |
exit(1); |
return 1; |
} |
} |
} |
} |
argv += optind; |
argv += optind; |
|
|
} |
} |
} |
} |
|
|
exit(exitval); |
return exitval; |
} |
} |