You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2002/04/13 21:35:18 UTC
cvs commit: httpd-2.0/support ab.c htdbm.c htdigest.c htpasswd.c rotatelogs.c
wrowe 02/04/13 12:35:18
Modified: server main.c
support ab.c htdbm.c htdigest.c htpasswd.c rotatelogs.c
Log:
Correct const'ness of argv in all support apps, and use the new
apr_app_initialize over apr_initialize for win32, and other platforms
that may wish to tweak 'apr-ized' application support (e.g. Netware?)
Revision Changes Path
1.126 +1 -1 httpd-2.0/server/main.c
Index: main.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/main.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -r1.125 -r1.126
--- main.c 4 Apr 2002 18:36:03 -0000 1.125
+++ main.c 13 Apr 2002 19:35:17 -0000 1.126
@@ -404,7 +404,7 @@
AP_MONCONTROL(0); /* turn of profiling of startup */
- apr_initialize();
+ apr_app_initialize(&argc, &argv, NULL);
process = create_process(argc, argv);
pglobal = process->pool;
1.94 +4 -4 httpd-2.0/support/ab.c
Index: ab.c
===================================================================
RCS file: /home/cvs/httpd-2.0/support/ab.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- ab.c 1 Apr 2002 04:32:40 -0000 1.93
+++ ab.c 13 Apr 2002 19:35:18 -0000 1.94
@@ -1302,14 +1302,14 @@
static void copyright(void)
{
if (!use_html) {
- printf("This is ApacheBench, Version %s\n", AP_SERVER_BASEREVISION " <$Revision: 1.93 $> apache-2.0");
+ printf("This is ApacheBench, Version %s\n", AP_SERVER_BASEREVISION " <$Revision: 1.94 $> apache-2.0");
printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n");
printf("\n");
}
else {
printf("<p>\n");
- printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_SERVER_BASEREVISION, "$Revision: 1.93 $");
+ printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_SERVER_BASEREVISION, "$Revision: 1.94 $");
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
printf("</p>\n<p>\n");
@@ -1467,7 +1467,7 @@
/* ------------------------------------------------------- */
/* sort out command-line args and call test */
-int main(int argc, const char *const argv[])
+int main(int argc, const char * const argv[])
{
int r, l;
char tmp[1024];
@@ -1485,7 +1485,7 @@
proxyhost[0] = '\0';
hdrs[0] = '\0';
- apr_initialize();
+ apr_app_initialize(&argc, &argv, NULL);
atexit(apr_terminate);
apr_pool_create(&cntxt, NULL);
1.9 +4 -3 httpd-2.0/support/htdbm.c
Index: htdbm.c
===================================================================
RCS file: /home/cvs/httpd-2.0/support/htdbm.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- htdbm.c 13 Mar 2002 20:48:06 -0000 1.8
+++ htdbm.c 13 Apr 2002 19:35:18 -0000 1.9
@@ -172,8 +172,6 @@
apr_status_t rv;
#endif
- apr_initialize();
- atexit(apr_terminate);
apr_pool_create( pool, NULL);
apr_signal(SIGINT, (void (*)(int)) htdbm_interrupted);
@@ -412,7 +410,7 @@
}
-int main(int argc, const char *argv[])
+int main(int argc, const char * const argv[])
{
apr_pool_t *pool;
apr_status_t rv;
@@ -430,6 +428,9 @@
int cmd = HTDBM_MAKE;
int i;
int args_left = 2;
+
+ apr_app_initialize(&argc, &argv, NULL);
+ atexit(apr_terminate);
if ((rv = htdbm_init(&pool, &h)) != APR_SUCCESS) {
fprintf(stderr, "Unable to initialize htdbm terminating!\n");
1.31 +3 -8 httpd-2.0/support/htdigest.c
Index: htdigest.c
===================================================================
RCS file: /home/cvs/httpd-2.0/support/htdigest.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- htdigest.c 13 Mar 2002 20:48:06 -0000 1.30
+++ htdigest.c 13 Apr 2002 19:35:18 -0000 1.31
@@ -147,7 +147,7 @@
}
-static void add_password(char *user, char *realm, apr_file_t *f)
+static void add_password(const char *user, const char *realm, apr_file_t *f)
{
char *pw;
apr_md5_ctx_t context;
@@ -214,7 +214,7 @@
apr_terminate();
}
-int main(int argc, char *argv[])
+int main(int argc, const char * const argv[])
{
apr_file_t *f;
apr_status_t rv;
@@ -228,12 +228,7 @@
char command[MAX_STRING_LEN];
int found;
- rv = apr_initialize();
- if (rv) {
- fprintf(stderr, "apr_initialize(): %s (%d)\n",
- apr_strerror(rv, line, sizeof(line)), rv);
- exit(1);
- }
+ apr_app_initialize(&argc, &argv, NULL);
atexit(terminate);
apr_pool_create(&cntxt, NULL);
1.41 +4 -6 httpd-2.0/support/htpasswd.c
Index: htpasswd.c
===================================================================
RCS file: /home/cvs/httpd-2.0/support/htpasswd.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- htpasswd.c 13 Mar 2002 20:48:06 -0000 1.40
+++ htpasswd.c 13 Apr 2002 19:35:18 -0000 1.41
@@ -376,7 +376,6 @@
void nwTerminate()
{
pressanykey();
- apr_terminate();
}
#endif
@@ -384,7 +383,7 @@
* Let's do it. We end up doing a lot of file opening and closing,
* but what do we care? This application isn't run constantly.
*/
-int main(int argc, char *argv[])
+int main(int argc, const char * const argv[])
{
FILE *ftemp = NULL;
FILE *fpw = NULL;
@@ -393,7 +392,7 @@
char record[MAX_STRING_LEN];
char line[MAX_STRING_LEN];
char pwfilename[MAX_STRING_LEN];
- char *arg;
+ const char *arg;
int found = 0;
int alg = ALG_CRYPT;
int newfile = 0;
@@ -407,11 +406,10 @@
apr_xlate_t *to_ascii;
#endif
- apr_initialize();
+ apr_app_initialize(&argc, &argv, NULL);
+ atexit(apr_terminate);
#ifdef NETWARE
atexit(nwTerminate);
-#else
- atexit(apr_terminate);
#endif
apr_pool_create(&pool, NULL);
1.21 +3 -3 httpd-2.0/support/rotatelogs.c
Index: rotatelogs.c
===================================================================
RCS file: /home/cvs/httpd-2.0/support/rotatelogs.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- rotatelogs.c 21 Mar 2002 10:10:41 -0000 1.20
+++ rotatelogs.c 13 Apr 2002 19:35:18 -0000 1.21
@@ -91,7 +91,7 @@
#define MAX_PATH 1024
#endif
-int main (int argc, char *argv[])
+int main (int argc, const char * const argv[])
{
char buf[BUFSIZE], buf2[MAX_PATH], errbuf[ERRMSGSZ];
int tLogEnd = 0, tRotation, utc_offset = 0;
@@ -99,11 +99,11 @@
apr_size_t nRead, nWrite;
int use_strftime = 0;
int now;
- char *szLogRoot;
+ const char *szLogRoot;
apr_file_t *f_stdin, *nLogFD = NULL, *nLogFDprev = NULL;
apr_pool_t *pool;
- apr_initialize();
+ apr_app_initialize(&argc, &argv, NULL);
atexit(apr_terminate);
apr_pool_create(&pool, NULL);