comparison src/tee/tee.c @ 21244:bc7ed647d654 v8.2.1173

patch 8.2.1173: tee doesn't build on some systems Commit: https://github.com/vim/vim/commit/40043152924827fa8c4064951065ff507c610164 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 10 20:45:31 2020 +0200 patch 8.2.1173: tee doesn't build on some systems Problem: Tee doesn't build on some systems. Solution: Include header files. (Dominique Pelle, closes https://github.com/vim/vim/issues/6431)
author Bram Moolenaar <Bram@vim.org>
date Fri, 10 Jul 2020 21:00:03 +0200
parents 6b5ce5161d6d
children ba435f6bc1ad
comparison
equal deleted inserted replaced
21243:671bfdceb417 21244:bc7ed647d654
30 #ifndef _MSC_VER 30 #ifndef _MSC_VER
31 # include <unistd.h> 31 # include <unistd.h>
32 #endif 32 #endif
33 #include <malloc.h> 33 #include <malloc.h>
34 #include <stdio.h> 34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <string.h>
35 #include <fcntl.h> 37 #include <fcntl.h>
36 38
37 #ifdef _WIN32 39 #ifdef _WIN32
38 # define sysconf(x) -1 40 # define sysconf(x) -1
39 #endif 41 #endif
130 { 132 {
131 fprintf(stderr, "Can't open \"%s\"\n", argv[i+optind]); 133 fprintf(stderr, "Can't open \"%s\"\n", argv[i+optind]);
132 exit(1); 134 exit(1);
133 } 135 }
134 } 136 }
137 #ifdef _WIN32
135 setmode(fileno(stdin), O_BINARY); 138 setmode(fileno(stdin), O_BINARY);
136 fflush(stdout); /* needed for _fsetmode(stdout) */ 139 fflush(stdout); /* needed for _fsetmode(stdout) */
137 setmode(fileno(stdout), O_BINARY); 140 setmode(fileno(stdout), O_BINARY);
141 #endif
138 142
139 while ((n = myfread(buf, sizeof(char), sizeof(buf), stdin)) > 0) 143 while ((n = myfread(buf, sizeof(char), sizeof(buf), stdin)) > 0)
140 { 144 {
141 fwrite(buf, sizeof(char), n, stdout); 145 fwrite(buf, sizeof(char), n, stdout);
142 fflush(stdout); 146 fflush(stdout);