diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-01-06 14:43:22 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2000-01-06 14:43:22 +0000 |
commit | 40de0d02842272180c1150c04345a2ea30aa7088 (patch) | |
tree | 1f0104f87e59b692031bbe592e8026b2088df304 /test | |
parent | 7a9ce03860a139580710ac5042830ec21dcf5226 (diff) | |
download | libapr-40de0d02842272180c1150c04345a2ea30aa7088.tar.gz |
Separate the stat structure from the file structure and use ap_stat and
ap_getfileinfo in apache.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@59574 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r-- | test/ab_apr.c | 6 | ||||
-rw-r--r-- | test/testmmap.c | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/test/ab_apr.c b/test/ab_apr.c index ab39b24d4..d1b6f52d1 100644 --- a/test/ab_apr.c +++ b/test/ab_apr.c @@ -858,6 +858,7 @@ static int parse_url(char *url) static int open_postfile(char *pfile) { ap_file_t *postfd = NULL; + ap_finfo_t finfo; ap_fileperms_t mode = APR_OS_DEFAULT; ap_ssize_t length; @@ -866,9 +867,8 @@ static int open_postfile(char *pfile) return errno; } - /* No need to perform stat here, the ap_open will do it for us. */ - - ap_get_filesize(&postlen, postfd); + ap_getfileinfo(&finfo, postfd); + postlen = finfo.size; postdata = (char *)malloc(postlen); if (!postdata) { printf("Can\'t alloc postfile buffer\n"); diff --git a/test/testmmap.c b/test/testmmap.c index 5a18deb93..8f16e6224 100644 --- a/test/testmmap.c +++ b/test/testmmap.c @@ -71,6 +71,7 @@ int main() ap_context_t *context; ap_mmap_t *themmap = NULL; ap_file_t *thefile = NULL; + ap_finfo_t finfo; ap_int32_t flag = APR_READ; char *file1; ap_ssize_t filesize; @@ -98,12 +99,12 @@ int main() } fprintf(stderr, "Getting file size..................."); - if (ap_get_filesize(&filesize, thefile) != APR_SUCCESS) { + if (ap_getfileinfo(&finfo, thefile) != APR_SUCCESS) { perror("Didn't open file"); exit(-1); } else { - fprintf(stdout, "%d bytes\n", filesize); + fprintf(stdout, "%d bytes\n", finfo.size); } fprintf(stdout,"Trying to mmap the open file........"); |