summaryrefslogtreecommitdiff
path: root/file_io
diff options
context:
space:
mode:
authorbojan <bojan@13f79535-47bb-0310-9956-ffa450edef68>2008-04-25 22:30:33 +0000
committerbojan <bojan@13f79535-47bb-0310-9956-ffa450edef68>2008-04-25 22:30:33 +0000
commit922aebfb8fc33176dffbb2dd29cbe8f9308486fb (patch)
tree23e1ae4873238efb760eb71c43f4ad68101ea4d8 /file_io
parentfe04727b4929278daa55edcb322b71348cda51c7 (diff)
downloadlibapr-922aebfb8fc33176dffbb2dd29cbe8f9308486fb.tar.gz
Rework possibly non-portable constant expression
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@651721 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r--file_io/unix/copy.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/file_io/unix/copy.c b/file_io/unix/copy.c
index c0d8021eb..3a1c59a62 100644
--- a/file_io/unix/copy.c
+++ b/file_io/unix/copy.c
@@ -52,10 +52,15 @@ static apr_status_t apr_file_transfer_contents(const char *from_path,
return status;
}
+#if BUFSIZ > APR_FILE_DEFAULT_BUFSIZE
+#define COPY_BUFSIZ BUFSIZ
+#else
+#define COPY_BUFSIZ APR_FILE_DEFAULT_BUFSIZE
+#endif
+
/* Copy bytes till the cows come home. */
while (1) {
- char buf[BUFSIZ > APR_FILE_DEFAULT_BUFSIZE ? BUFSIZ
- : APR_FILE_DEFAULT_BUFSIZE];
+ char buf[COPY_BUFSIZ];
apr_size_t bytes_this_time = sizeof(buf);
apr_status_t read_err;
apr_status_t write_err;