diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-08-22 19:54:12 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-08-22 19:54:12 +0200 |
| commit | aa3576a29b9619f4e1c1b131f5db53ad2bc2cb00 (patch) | |
| tree | 9dba84b07e8dda7f82a8dba84299bab21e6b9fd2 /include | |
| parent | d8e61bbf13d0cf38d477255cfd5dc71c5d51d575 (diff) | |
| download | busybox-w32-aa3576a29b9619f4e1c1b131f5db53ad2bc2cb00.tar.gz busybox-w32-aa3576a29b9619f4e1c1b131f5db53ad2bc2cb00.tar.bz2 busybox-w32-aa3576a29b9619f4e1c1b131f5db53ad2bc2cb00.zip | |
hush: fix "redirects can close script fd" bug
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/libbb.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/include/libbb.h b/include/libbb.h index e39021eb1..b2e4299dd 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -185,24 +185,32 @@ int klogctl(int type, char *b, int len); | |||
| 185 | /* Busybox does not use threads, we can speed up stdio. */ | 185 | /* Busybox does not use threads, we can speed up stdio. */ |
| 186 | #ifdef HAVE_UNLOCKED_STDIO | 186 | #ifdef HAVE_UNLOCKED_STDIO |
| 187 | # undef getc | 187 | # undef getc |
| 188 | # define getc(stream) getc_unlocked(stream) | 188 | # define getc(stream) getc_unlocked(stream) |
| 189 | # undef getchar | 189 | # undef getchar |
| 190 | # define getchar() getchar_unlocked() | 190 | # define getchar() getchar_unlocked() |
| 191 | # undef putc | 191 | # undef putc |
| 192 | # define putc(c, stream) putc_unlocked(c, stream) | 192 | # define putc(c,stream) putc_unlocked(c,stream) |
| 193 | # undef putchar | 193 | # undef putchar |
| 194 | # define putchar(c) putchar_unlocked(c) | 194 | # define putchar(c) putchar_unlocked(c) |
| 195 | # undef fgetc | 195 | # undef fgetc |
| 196 | # define fgetc(stream) getc_unlocked(stream) | 196 | # define fgetc(stream) getc_unlocked(stream) |
| 197 | # undef fputc | 197 | # undef fputc |
| 198 | # define fputc(c, stream) putc_unlocked(c, stream) | 198 | # define fputc(c,stream) putc_unlocked(c,stream) |
| 199 | #endif | 199 | #endif |
| 200 | /* Above functions are required by POSIX.1-2008, below ones are extensions */ | 200 | /* Above functions are required by POSIX.1-2008, below ones are extensions */ |
| 201 | #ifdef HAVE_UNLOCKED_LINE_OPS | 201 | #ifdef HAVE_UNLOCKED_LINE_OPS |
| 202 | # undef fgets | 202 | # undef fgets |
| 203 | # define fgets(s, n, stream) fgets_unlocked(s, n, stream) | 203 | # define fgets(s,n,stream) fgets_unlocked(s,n,stream) |
| 204 | # undef fputs | 204 | # undef fputs |
| 205 | # define fputs(s, stream) fputs_unlocked(s, stream) | 205 | # define fputs(s,stream) fputs_unlocked(s,stream) |
| 206 | # undef fflush | ||
| 207 | # define fflush(stream) fflush_unlocked(stream) | ||
| 208 | # undef feof | ||
| 209 | # define feof(stream) feof_unlocked(stream) | ||
| 210 | # undef ferror | ||
| 211 | # define ferror(stream) ferror_unlocked(stream) | ||
| 212 | # undef fileno | ||
| 213 | # define fileno(stream) fileno_unlocked(stream) | ||
| 206 | #endif | 214 | #endif |
| 207 | 215 | ||
| 208 | 216 | ||
