diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index b1c9ba9660..00e1f48081 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,7 @@ +2008-10-02 Joel Sherrill + + * libmisc/shell/utils-cp.c: Do not put a 64K buffer on the stack. + 2008-10-02 Joel Sherrill * score/inline/rtems/score/priority.inl: Use simple integer as loop diff --git a/cpukit/libmisc/shell/utils-cp.c b/cpukit/libmisc/shell/utils-cp.c index d2eb0adf51..3da0722572 100644 --- a/cpukit/libmisc/shell/utils-cp.c +++ b/cpukit/libmisc/shell/utils-cp.c @@ -69,6 +69,9 @@ __RCSID("$NetBSD: utils.c,v 1.29 2005/10/15 18:22:18 christos Exp $"); #define cp_pct(x, y) ((y == 0) ? 0 : (int)(100.0 * (x) / (y))) +/* original was MAXBSIZE which results in 64K on the stack */ +#define MAX_READ 1024 + int set_utimes(const char *file, struct stat *fs) { @@ -87,7 +90,7 @@ set_utimes(const char *file, struct stat *fs) int copy_file(rtems_shell_cp_globals* cp_globals, FTSENT *entp, int dne) { - static char buf[MAXBSIZE]; + static char buf[MAX_READ]; struct stat *fs; ssize_t wcount; size_t wresid; @@ -204,7 +207,7 @@ copy_file(rtems_shell_cp_globals* cp_globals, FTSENT *entp, int dne) #endif { wtotal = 0; - while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) { + while ((rcount = read(from_fd, buf, MAX_READ)) > 0) { for (bufp = buf, wresid = rcount; ; bufp += wcount, wresid -= wcount) { wcount = write(to_fd, bufp, wresid);