You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dr...@hyperreal.org on 1999/12/15 13:20:41 UTC
cvs commit: apache-2.0/src/lib/apr/test htdigest.c testmmap.c
dreid 99/12/15 04:20:41
Modified: src/lib/apr/test htdigest.c testmmap.c
Log:
Get the mmap test working again and tidy up in htdigest.
Revision Changes Path
1.10 +9 -0 apache-2.0/src/lib/apr/test/htdigest.c
Index: htdigest.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/test/htdigest.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- htdigest.c 1999/12/03 16:12:27 1.9
+++ htdigest.c 1999/12/15 12:20:40 1.10
@@ -66,12 +66,21 @@
* by Alexei Kosut, based on htpasswd.c, by Rob McCool
*/
+#include "apr_config.h"
#include "apr_lib.h"
#include "apr_md5.h"
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
+#endif
+#ifdef HAVE_SIGNAL_H
#include <signal.h>
+#endif
+#ifdef HAVE_STDLIB_H
#include <stdlib.h>
+#endif
#ifdef WIN32
#include <conio.h>
1.4 +11 -8 apache-2.0/src/lib/apr/test/testmmap.c
Index: testmmap.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testmmap.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- testmmap.c 1999/12/03 15:18:36 1.3
+++ testmmap.c 1999/12/15 12:20:40 1.4
@@ -73,6 +73,7 @@
ap_file_t *thefile;
ap_int32_t flag = APR_READ;
char *file1;
+ ap_ssize_t filesize;
fprintf (stdout,"APR MMAP Test\n*************\n\n");
@@ -87,13 +88,6 @@
getcwd(file1, PATH_LEN);
strncat(file1,"/testmmap.c",11);
- fprintf(stdout,"Trying to delete the mmap file......");
- if (ap_mmap_delete(themmap) != APR_SUCCESS) {
- fprintf(stderr,"Failed!\n");
- exit (-1);
- }
- fprintf(stdout,"OK\n\n");
-
fprintf(stdout, "Opening file........................");
if (ap_open(&thefile, file1, flag, APR_UREAD | APR_GREAD, context) != APR_SUCCESS) {
perror("Didn't open file");
@@ -102,9 +96,18 @@
else {
fprintf(stdout, "OK\n");
}
+
+ fprintf(stderr, "Getting file size...................");
+ if (ap_get_filesize(&filesize, thefile) != APR_SUCCESS) {
+ perror("Didn't open file");
+ exit(-1);
+ }
+ else {
+ fprintf(stdout, "%d bytes\n", filesize);
+ }
fprintf(stdout,"Trying to mmap the open file........");
- if (ap_mmap_create(&themmap, thefile, 0, 0, context) != APR_SUCCESS) {
+ if (ap_mmap_create(&themmap, thefile, 0, filesize, context) != APR_SUCCESS) {
fprintf(stderr,"Failed!\n");
exit(-1);
}
Re: cvs commit: apache-2.0/src/lib/apr/test htdigest.c testmmap.c
Posted by David Reid <ab...@dial.pipex.com>.
Whoops. You're right of course.
d.
----- Original Message -----
From: "Ryan Bloom" <rb...@raleigh.ibm.com>
To: <ne...@apache.org>
Cc: <ap...@apache.org>
Sent: Wednesday, December 15, 1999 3:34 PM
Subject: Re: cvs commit: apache-2.0/src/lib/apr/test htdigest.c testmmap.c
>
> > Index: htdigest.c
> > ===================================================================
> > RCS file: /home/cvs/apache-2.0/src/lib/apr/test/htdigest.c,v
> > retrieving revision 1.9
> > retrieving revision 1.10
> > diff -u -r1.9 -r1.10
> > --- htdigest.c 1999/12/03 16:12:27 1.9
> > +++ htdigest.c 1999/12/15 12:20:40 1.10
> > @@ -66,12 +66,21 @@
> > * by Alexei Kosut, based on htpasswd.c, by Rob McCool
> > */
> >
> > +#include "apr_config.h"
> > #include "apr_lib.h"
> > #include "apr_md5.h"
> > +#ifdef HAVE_SYS_TYPES_H
> > #include <sys/types.h>
> > +#endif
> > +#ifdef HAVE_SYS_SIGNAL_H
> > #include <sys/signal.h>
> > +#endif
> > +#ifdef HAVE_SIGNAL_H
> > #include <signal.h>
> > +#endif
> > +#ifdef HAVE_STDLIB_H
> > #include <stdlib.h>
> > +#endif
>
> None of the test programs can include apr_config.h or use HAVE_FOO_H tests
> anymore. This is because apr_config.h is a private header file, and is
> not available to programs using apr. Test programs should only include
> apr.h. The HAVE_FOO_H macros are by definition internal only, because
> they do not protect namespace. This part of the patch needs to be
> backed out, because it does not really test APR's ability to abstract
> information.
>
> Ryan
> _______________________________________________________________________
> Ryan Bloom rbb@raleigh.ibm.com
> 4205 S Miami Blvd
> RTP, NC 27709 It's a beautiful sight to see good dancers
> doing simple steps. It's a painful sight to
> see beginners doing complicated patterns.
>
Re: cvs commit: apache-2.0/src/lib/apr/test htdigest.c testmmap.c
Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
> Index: htdigest.c
> ===================================================================
> RCS file: /home/cvs/apache-2.0/src/lib/apr/test/htdigest.c,v
> retrieving revision 1.9
> retrieving revision 1.10
> diff -u -r1.9 -r1.10
> --- htdigest.c 1999/12/03 16:12:27 1.9
> +++ htdigest.c 1999/12/15 12:20:40 1.10
> @@ -66,12 +66,21 @@
> * by Alexei Kosut, based on htpasswd.c, by Rob McCool
> */
>
> +#include "apr_config.h"
> #include "apr_lib.h"
> #include "apr_md5.h"
> +#ifdef HAVE_SYS_TYPES_H
> #include <sys/types.h>
> +#endif
> +#ifdef HAVE_SYS_SIGNAL_H
> #include <sys/signal.h>
> +#endif
> +#ifdef HAVE_SIGNAL_H
> #include <signal.h>
> +#endif
> +#ifdef HAVE_STDLIB_H
> #include <stdlib.h>
> +#endif
None of the test programs can include apr_config.h or use HAVE_FOO_H tests
anymore. This is because apr_config.h is a private header file, and is
not available to programs using apr. Test programs should only include
apr.h. The HAVE_FOO_H macros are by definition internal only, because
they do not protect namespace. This part of the patch needs to be
backed out, because it does not really test APR's ability to abstract
information.
Ryan
_______________________________________________________________________
Ryan Bloom rbb@raleigh.ibm.com
4205 S Miami Blvd
RTP, NC 27709 It's a beautiful sight to see good dancers
doing simple steps. It's a painful sight to
see beginners doing complicated patterns.
Re: cvs commit: apache-2.0/src/lib/apr/test htdigest.c testmmap.c
Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
> Index: htdigest.c
> ===================================================================
> RCS file: /home/cvs/apache-2.0/src/lib/apr/test/htdigest.c,v
> retrieving revision 1.9
> retrieving revision 1.10
> diff -u -r1.9 -r1.10
> --- htdigest.c 1999/12/03 16:12:27 1.9
> +++ htdigest.c 1999/12/15 12:20:40 1.10
> @@ -66,12 +66,21 @@
> * by Alexei Kosut, based on htpasswd.c, by Rob McCool
> */
>
> +#include "apr_config.h"
> #include "apr_lib.h"
> #include "apr_md5.h"
> +#ifdef HAVE_SYS_TYPES_H
> #include <sys/types.h>
> +#endif
> +#ifdef HAVE_SYS_SIGNAL_H
> #include <sys/signal.h>
> +#endif
> +#ifdef HAVE_SIGNAL_H
> #include <signal.h>
> +#endif
> +#ifdef HAVE_STDLIB_H
> #include <stdlib.h>
> +#endif
None of the test programs can include apr_config.h or use HAVE_FOO_H tests
anymore. This is because apr_config.h is a private header file, and is
not available to programs using apr. Test programs should only include
apr.h. The HAVE_FOO_H macros are by definition internal only, because
they do not protect namespace. This part of the patch needs to be
backed out, because it does not really test APR's ability to abstract
information.
Ryan
_______________________________________________________________________
Ryan Bloom rbb@raleigh.ibm.com
4205 S Miami Blvd
RTP, NC 27709 It's a beautiful sight to see good dancers
doing simple steps. It's a painful sight to
see beginners doing complicated patterns.