aboutsummaryrefslogtreecommitdiff
path: root/libbb/copyfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/copyfd.c')
-rw-r--r--libbb/copyfd.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 805b80187..e0596d5f6 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -7,19 +7,15 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include <errno.h>
11#include <stdlib.h>
12#include <string.h>
13#include <unistd.h>
14
15#include "libbb.h" 10#include "libbb.h"
16 11
17
18#if BUFSIZ < 4096 12#if BUFSIZ < 4096
19#undef BUFSIZ 13#undef BUFSIZ
20#define BUFSIZ 4096 14#define BUFSIZ 4096
21#endif 15#endif
22 16
17/* Used by NOFORK applets (e.g. cat) - must be very careful
18 * when calling xfuncs, allocating memory, with signals, termios, etc... */
23 19
24static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size) 20static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
25{ 21{
@@ -27,7 +23,8 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
27 off_t total = 0; 23 off_t total = 0;
28 RESERVE_CONFIG_BUFFER(buffer, BUFSIZ); 24 RESERVE_CONFIG_BUFFER(buffer, BUFSIZ);
29 25
30 if (src_fd < 0) goto out; 26 if (src_fd < 0)
27 goto out;
31 28
32 if (!size) { 29 if (!size) {
33 size = BUFSIZ; 30 size = BUFSIZ;