Actually; I've just written this for an in-house experiment at covalent;
by just using function pointers. See attached hack to get an idea. It is
not ready for submittal - as it does not yet have sensible default choise.
Dw
On Fri, 22 Jun 2001, Jim Jagielski wrote:
> I've been toying with the idea of making the accept mutex selection
> a runtime rather than compile-time option. This makes sense to me
> for certain applications. At present, however, APR decides the mutex
> type and Apache uses that. So we either need some way for APR to
> determine all possible available options, and then "enable" them
> (provide the required calls) and then have an Apache directive do the
> required right-thing to pick the one you want.
>
> One way would be to add another argument to the APR call that defines
> the lock type (enum would be best, 'natch). Whatcha think?
>
Index: src/include/ap_config.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/ap_config.h,v
retrieving revision 1.305
diff -u -r1.305 ap_config.h
--- src/include/ap_config.h 2001/02/19 23:56:20 1.305
+++ src/include/ap_config.h 2001/06/20 23:19:12
@@ -179,10 +179,9 @@
#define NO_KILLPG
#undef NO_SETSID
#define bzero(a,b) memset(a,0,b)
-#if !defined(USE_SYSVSEM_SERIALIZED_ACCEPT) && \
- !defined(USE_PTHREAD_SERIALIZED_ACCEPT)
+#define USE_SYSVSEM_SERIALIZED_ACCEPT
+#define USE_PTHREAD_SERIALIZED_ACCEPT
#define USE_FCNTL_SERIALIZED_ACCEPT
-#endif
#define NEED_UNION_SEMUN
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
@@ -433,6 +432,8 @@
#define JMP_BUF jmp_buf
#define USE_LONGJMP
#define USE_FLOCK_SERIALIZED_ACCEPT
+#define USE_FCNTL_SERIALIZED_ACCEPT
+#define USE_NONE_SERIALIZED_ACCEPT
#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
/*
* If you are using APACI, (you probably should be on Mac OS) these
Index: src/include/http_main.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/include/http_main.h,v
retrieving revision 1.36
diff -u -r1.36 http_main.h
--- src/include/http_main.h 2001/01/15 17:04:34 1.36
+++ src/include/http_main.h 2001/06/20 23:19:12
@@ -130,6 +130,9 @@
void setup_signal_names(char *prefix);
+char * init_mutex_method(char *t);
+char * init_single_listen( int flag );
+
#ifndef NO_OTHER_CHILD
/*
* register an other_child -- a child which the main loop keeps track of
Index: src/main/http_core.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_core.c,v
retrieving revision 1.295
diff -u -r1.295 http_core.c
--- src/main/http_core.c 2001/03/09 10:10:25 1.295
+++ src/main/http_core.c 2001/06/20 23:19:15
@@ -1135,6 +1135,14 @@
}
return NULL;
}
+static const char *set_accept_method(cmd_parms *cmd, void *dummy, char *arg)
+{
+ return init_mutex_method(arg);
+}
+static const char *set_single_listen(cmd_parms *cmd, void *dummy, int flag)
+{
+ return init_single_listen(flag ? 1 : 0);
+}
static const char *set_document_root(cmd_parms *cmd, void *dummy, char *arg)
{
@@ -3187,6 +3195,37 @@
(void*)XtOffsetOf(core_dir_config, limit_req_body),
OR_ALL, TAKE1,
"Limit (in bytes) on maximum size of request message body" },
+{ "AcceptMethod", set_accept_method, NULL, RSRC_CONF, TAKE1,
+ "Serialized AcceptMethod; the methods "
+#ifdef USE_FCNTL_SERIALIZED_ACCEPT
+ "'fcntl' "
+#endif
+#ifdef USE_FLOCK_SERIALIZED_ACCEPT
+ "'flock' "
+#endif
+#ifdef USE_USLOCK_SERIALIZED_ACCEPT
+ "'uslock "
+#endif
+#ifdef USE_SYSVSEM_SERIALIZED_ACCEPT
+ "'sysvsem' "
+#endif
+#ifdef USE_PTHREAD_SERIALIZED_ACCEPT
+ "'pthread' "
+#endif
+#ifdef USE_OS2SEM_SERIALIZED_ACCEPT
+ "'os2sem' "
+#endif
+#ifdef USE_TPF_CORE_SERIALIZED_ACCEPT
+ "'tpfcore' "
+#endif
+#ifdef USE_NONE_SERIALIZED_ACCEPT
+ "'none' "
+#endif
+ "are compiled in"
+},
+{ "SingleListen",set_single_listen,NULL,RSRC_CONF,FLAG,
+ "On - to serialize accept and Off to unserialize accept"
+},
/* EBCDIC Conversion directives: */
#ifdef CHARSET_EBCDIC
Index: src/main/http_main.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.533
diff -u -r1.533 http_main.c
--- src/main/http_main.c 2001/03/26 19:25:54 1.533
+++ src/main/http_main.c 2001/06/20 23:19:16
@@ -504,14 +504,12 @@
#endif
#if defined (USE_USLOCK_SERIALIZED_ACCEPT)
-
#include <ulocks.h>
-
static ulock_t uslock = NULL;
-#define accept_mutex_child_init(x)
+#define accept_mutex_child_init_uslock(x)
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init_uslock(pool *p)
{
ptrdiff_t old;
usptr_t *us;
@@ -542,7 +540,7 @@
}
}
-static void accept_mutex_on(void)
+static void accept_mutex_on_uslock(void)
{
switch (ussetlock(uslock)) {
case 1:
@@ -557,15 +555,16 @@
}
}
-static void accept_mutex_off(void)
+static void accept_mutex_off_uslock(void)
{
if (usunsetlock(uslock) == -1) {
perror("usunsetlock");
clean_child_exit(APEXIT_CHILDFATAL);
}
}
+#endif
-#elif defined (USE_PTHREAD_SERIALIZED_ACCEPT)
+#if defined (USE_PTHREAD_SERIALIZED_ACCEPT)
/* This code probably only works on Solaris ... but it works really fast
* on Solaris. Note that pthread mutexes are *NOT* released when a task
@@ -580,7 +579,7 @@
static sigset_t accept_block_mask;
static sigset_t accept_previous_mask;
-static void accept_mutex_child_cleanup(void *foo)
+static void accept_mutex_child_cleanup_pthread(void *foo)
{
if (accept_mutex != (void *)(caddr_t)-1
&& have_accept_mutex) {
@@ -588,12 +587,12 @@
}
}
-static void accept_mutex_child_init(pool *p)
+static void accept_mutex_child_init_pthread(pool *p)
{
- ap_register_cleanup(p, NULL, accept_mutex_child_cleanup, ap_null_cleanup);
+ ap_register_cleanup(p, NULL, accept_mutex_child_cleanup_pthread,
ap_null_cleanup);
}
-static void accept_mutex_cleanup(void *foo)
+static void accept_mutex_cleanup_pthread(void *foo)
{
if (accept_mutex != (void *)(caddr_t)-1
&& munmap((caddr_t) accept_mutex, sizeof(*accept_mutex))) {
@@ -602,7 +601,7 @@
accept_mutex = (void *)(caddr_t)-1;
}
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init_pthread(pool *p)
{
pthread_mutexattr_t mattr;
int fd;
@@ -636,10 +635,10 @@
sigdelset(&accept_block_mask, SIGHUP);
sigdelset(&accept_block_mask, SIGTERM);
sigdelset(&accept_block_mask, SIGUSR1);
- ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
+ ap_register_cleanup(p, NULL, accept_mutex_cleanup_pthread,
ap_null_cleanup);
}
-static void accept_mutex_on(void)
+static void accept_mutex_on_pthread(void)
{
int err;
@@ -661,7 +660,7 @@
ap_unblock_alarms();
}
-static void accept_mutex_off(void)
+static void accept_mutex_off_pthread(void)
{
int err;
@@ -682,8 +681,9 @@
clean_child_exit(1);
}
}
+#endif
-#elif defined (USE_SYSVSEM_SERIALIZED_ACCEPT)
+#if defined (USE_SYSVSEM_SERIALIZED_ACCEPT)
#include <sys/types.h>
#include <sys/ipc.h>
@@ -707,7 +707,7 @@
* means we have to be sure to clean this up or else we'll leak
* semaphores.
*/
-static void accept_mutex_cleanup(void *foo)
+static void accept_mutex_cleanup_sysvsem(void *foo)
{
union semun ick;
@@ -718,9 +718,9 @@
semctl(sem_id, 0, IPC_RMID, ick);
}
-#define accept_mutex_child_init(x)
+#define accept_mutex_child_init_sysvsem(x)
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init_sysvsem(pool *p)
{
union semun ick;
struct semid_ds buf;
@@ -749,7 +749,7 @@
exit(APEXIT_INIT);
}
}
- ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
+ ap_register_cleanup(p, NULL, accept_mutex_cleanup_sysvsem,
ap_null_cleanup);
/* pre-initialize these */
op_on.sem_num = 0;
@@ -760,7 +760,7 @@
op_off.sem_flg = SEM_UNDO;
}
-static void accept_mutex_on(void)
+static void accept_mutex_on_sysvsem(void)
{
while (semop(sem_id, &op_on, 1) < 0) {
if (errno != EINTR) {
@@ -770,7 +770,7 @@
}
}
-static void accept_mutex_off(void)
+static void accept_mutex_off_sysvsem(void)
{
while (semop(sem_id, &op_off, 1) < 0) {
if (errno != EINTR) {
@@ -779,20 +779,21 @@
}
}
}
+#endif
-#elif defined(USE_FCNTL_SERIALIZED_ACCEPT)
+#if defined(USE_FCNTL_SERIALIZED_ACCEPT)
static struct flock lock_it;
static struct flock unlock_it;
static int lock_fd = -1;
-#define accept_mutex_child_init(x)
+#define accept_mutex_child_init_fcntl(x)
/*
* Initialize mutex lock.
* Must be safe to call this on a restart.
*/
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init_fcntl(pool *p)
{
lock_it.l_whence = SEEK_SET; /* from current point */
@@ -816,7 +817,7 @@
unlink(ap_lock_fname);
}
-static void accept_mutex_on(void)
+static void accept_mutex_on_fcntl(void)
{
int ret;
@@ -833,7 +834,7 @@
}
}
-static void accept_mutex_off(void)
+static void accept_mutex_off_fcntl(void)
{
int ret;
@@ -848,12 +849,13 @@
clean_child_exit(APEXIT_CHILDFATAL);
}
}
+#endif
-#elif defined(USE_FLOCK_SERIALIZED_ACCEPT)
+#if defined(USE_FLOCK_SERIALIZED_ACCEPT)
-static int lock_fd = -1;
+static int flock_fd = -1;
-static void accept_mutex_cleanup(void *foo)
+static void accept_mutex_cleanup_flock(void *foo)
{
unlink(ap_lock_fname);
}
@@ -862,11 +864,11 @@
* Initialize mutex lock.
* Done by each child at it's birth
*/
-static void accept_mutex_child_init(pool *p)
+static void accept_mutex_child_init_flock(pool *p)
{
- lock_fd = ap_popenf(p, ap_lock_fname, O_WRONLY, 0600);
- if (lock_fd == -1) {
+ flock_fd = ap_popenf(p, ap_lock_fname, O_WRONLY, 0600);
+ if (flock_fd == -1) {
ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
"Child cannot open lock file: %s", ap_lock_fname);
clean_child_exit(APEXIT_CHILDINIT);
@@ -877,24 +879,24 @@
* Initialize mutex lock.
* Must be safe to call this on a restart.
*/
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init_flock(pool *p)
{
expand_lock_fname(p);
unlink(ap_lock_fname);
- lock_fd = ap_popenf(p, ap_lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0600);
- if (lock_fd == -1) {
+ flock_fd = ap_popenf(p, ap_lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0600);
+ if (flock_fd == -1) {
ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
"Parent cannot open lock file: %s", ap_lock_fname);
exit(APEXIT_INIT);
}
- ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
+ ap_register_cleanup(p, NULL, accept_mutex_cleanup_flock, ap_null_cleanup);
}
-static void accept_mutex_on(void)
+static void accept_mutex_on_flock(void)
{
int ret;
- while ((ret = flock(lock_fd, LOCK_EX)) < 0 && errno == EINTR)
+ while ((ret = flock(flock_fd, LOCK_EX)) < 0 && errno == EINTR)
continue;
if (ret < 0) {
@@ -904,20 +906,21 @@
}
}
-static void accept_mutex_off(void)
+static void accept_mutex_off_flock(void)
{
- if (flock(lock_fd, LOCK_UN) < 0) {
+ if (flock(flock_fd, LOCK_UN) < 0) {
ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
"flock: LOCK_UN: Error freeing accept lock. Exiting!");
clean_child_exit(APEXIT_CHILDFATAL);
}
}
+#endif
-#elif defined(USE_OS2SEM_SERIALIZED_ACCEPT)
+#if defined(USE_OS2SEM_SERIALIZED_ACCEPT)
static HMTX lock_sem = -1;
-static void accept_mutex_cleanup(void *foo)
+static void accept_mutex_cleanup_os2sem(void *foo)
{
DosReleaseMutexSem(lock_sem);
DosCloseMutexSem(lock_sem);
@@ -927,7 +930,7 @@
* Initialize mutex lock.
* Done by each child at it's birth
*/
-static void accept_mutex_child_init(pool *p)
+static void accept_mutex_child_init_os2sem(pool *p)
{
int rc = DosOpenMutexSem(NULL, &lock_sem);
@@ -936,7 +939,7 @@
"Child cannot open lock semaphore, rc=%d", rc);
clean_child_exit(APEXIT_CHILDINIT);
} else {
- ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
+ ap_register_cleanup(p, NULL, accept_mutex_cleanup_os2sem,
ap_null_cleanup);
}
}
@@ -944,7 +947,7 @@
* Initialize mutex lock.
* Must be safe to call this on a restart.
*/
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init_os2sem(pool *p)
{
int rc = DosCreateMutexSem(NULL, &lock_sem, DC_SEM_SHARED, FALSE);
@@ -954,10 +957,10 @@
exit(APEXIT_INIT);
}
- ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
+ ap_register_cleanup(p, NULL, accept_mutex_cleanup_os2sem, ap_null_cleanup);
}
-static void accept_mutex_on(void)
+static void accept_mutex_on_os2sem(void)
{
int rc = DosRequestMutexSem(lock_sem, SEM_INDEFINITE_WAIT);
@@ -968,7 +971,7 @@
}
}
-static void accept_mutex_off(void)
+static void accept_mutex_off_os2sem(void)
{
int rc = DosReleaseMutexSem(lock_sem);
@@ -978,65 +981,170 @@
clean_child_exit(APEXIT_CHILDFATAL);
}
}
+#endif
-#elif defined(USE_TPF_CORE_SERIALIZED_ACCEPT)
+#if defined(USE_TPF_CORE_SERIALIZED_ACCEPT)
static int tpf_core_held;
-static void accept_mutex_cleanup(void *foo)
+static void accept_mutex_cleanup_tpfcore(void *foo)
{
if(tpf_core_held)
coruc(RESOURCE_KEY);
}
-#define accept_mutex_init(x)
+#define accept_mutex_init_tpfcore(x)
-static void accept_mutex_child_init(pool *p)
+static void accept_mutex_child_init_tpfcore(pool *p)
{
- ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
+ ap_register_cleanup(p, NULL, accept_mutex_cleanup_tpfcore,
ap_null_cleanup);
tpf_core_held = 0;
}
-static void accept_mutex_on(void)
+static void accept_mutex_on_tpfcore(void)
{
corhc(RESOURCE_KEY);
tpf_core_held = 1;
ap_check_signals();
}
-static void accept_mutex_off(void)
+static void accept_mutex_off_tpfcore(void)
{
coruc(RESOURCE_KEY);
tpf_core_held = 0;
ap_check_signals();
}
+#endif
-#else
-/* Default --- no serialization. Other methods *could* go here,
- * as #elifs...
- */
#if !defined(MULTITHREAD)
/* Multithreaded systems don't complete between processes for
* the sockets. */
#define NO_SERIALIZED_ACCEPT
-#define accept_mutex_child_init(x)
-#define accept_mutex_init(x)
-#define accept_mutex_on()
-#define accept_mutex_off()
+#define accept_mutex_child_init_none(x)
+#define accept_mutex_init_none(x)
+#define accept_mutex_on_none()
+#define accept_mutex_off_none()
#endif
+
+void _trap_unconfig(pool *p)
+{
+ fprintf(stderr,"No accept mutex configured\n");
+ exit(1);
+}
+
+void (*accept_mutex_child_init_fptr)(pool *) = &_trap_unconfig;
+void (*accept_mutex_init_fptr)(pool *) = &_trap_unconfig;
+void (*accept_mutex_off_fptr)(void);
+void (*accept_mutex_on_fptr)(void);
+
+#define _D_PTR(x,y) { if (x) ((* x)(y)); }
+#define _E_PTR(x) { if (x) ((* x)()); }
+#define accept_mutex_child_init(x) _D_PTR(accept_mutex_child_init_fptr,x)
+#define accept_mutex_init(x) _D_PTR(accept_mutex_init_fptr,x)
+#define accept_mutex_off() _E_PTR(accept_mutex_off_fptr)
+#define accept_mutex_on() _E_PTR(accept_mutex_on_fptr)
+
+char * init_mutex_method(char *t)
+{
+#if defined USE_USLOCK_SERIALIZED_ACCEPT
+ if (!(strcmp(t,"uslock"))) {
+ accept_mutex_child_init_fptr = NULL;
+ accept_mutex_init_fptr = &accept_mutex_init_uslock;
+ accept_mutex_off_fptr = &accept_mutex_off_uslock;
+ accept_mutex_on_fptr = &accept_mutex_on_uslock;
+ } else
+#endif
+#if defined USE_PTHREAD_SERIALIZED_ACCEPT
+ if (!(strcmp(t,"pthread"))) {
+ accept_mutex_child_init_fptr = &accept_mutex_child_init_pthread;
+ accept_mutex_init_fptr = &accept_mutex_init_pthread;
+ accept_mutex_off_fptr = &accept_mutex_off_pthread;
+ accept_mutex_on_fptr = &accept_mutex_on_pthread;
+ } else
+#endif
+#if defined USE_SYSVSEM_SERIALIZED_ACCEPT
+ if (!(strcmp(t,"sysvsem"))) {
+ accept_mutex_child_init_fptr = NULL;
+ accept_mutex_init_fptr = &accept_mutex_init_sysvsem;
+ accept_mutex_off_fptr = &accept_mutex_off_sysvsem;
+ accept_mutex_on_fptr = &accept_mutex_on_sysvsem;
+ } else
+#endif
+#if defined USE_FCNTL_SERIALIZED_ACCEPT
+ if (!(strcmp(t,"fcntl"))) {
+ accept_mutex_child_init_fptr = NULL;
+ accept_mutex_init_fptr = &accept_mutex_init_fcntl;
+ accept_mutex_off_fptr = &accept_mutex_off_fcntl;
+ accept_mutex_on_fptr = &accept_mutex_on_fcntl;
+ } else
+#endif
+#if defined USE_FLOCK_SERIALIZED_ACCEPT
+ if (!(strcmp(t,"flock"))) {
+ accept_mutex_child_init_fptr = &accept_mutex_child_init_flock;
+ accept_mutex_init_fptr = &accept_mutex_init_flock;
+ accept_mutex_off_fptr = &accept_mutex_off_flock;
+ accept_mutex_on_fptr = &accept_mutex_on_flock;
+ } else
+#endif
+#if defined USE_OS2SEM_SERIALIZED_ACCEPT
+ if (!(strcmp(t,"os2sem"))) {
+ accept_mutex_child_init_fptr = &accept_mutex_child_init_os2sem;
+ accept_mutex_init_fptr = &accept_mutex_init_os2sem;
+ accept_mutex_off_fptr = &accept_mutex_off_os2sem;
+ accept_mutex_on_fptr = &accept_mutex_on_os2sem;
+ } else
+#endif
+#if defined USE_TPF_CORE_SERIALIZED_ACCEPT
+ if (!(strcmp(t,"tpfcore"))) {
+ accept_mutex_child_init_fptr =
&accept_mutex_child_init_tpfcore;
+ accept_mutex_init_fptr = NULLL;
+ accept_mutex_off_fptr = &accept_mutex_off_tpfcore;
+ accept_mutex_on_fptr = &accept_mutex_on_tpfcore;
+ } else
+#endif
+#if defined USE_NONE_CORE_SERIALIZED_ACCEPT
+ if (!(strcmp(t,"none"))) {
+ accept_mutex_child_init_fptr = NULL;
+ accept_mutex_init_fptr = NULL;
+ accept_mutex_off_fptr = NULL;
+ accept_mutex_on_fptr = NULL;
+ } else
#endif
+ return "No compiled in serialized accept method defined";
+
+ return NULL;
+}
/* On some architectures it's safe to do unserialized accept()s in the single
* Listen case. But it's never safe to do it in the case where there's
* multiple Listen statements. Define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
* when it's safe in the single Listen case.
*/
+int _single_accept
#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-#define SAFE_ACCEPT(stmt) do {if(ap_listeners->next != ap_listeners) {stmt;}}
while(0)
+ = 1;
#else
-#define SAFE_ACCEPT(stmt) do {stmt;} while(0)
+ = 0;
#endif
+char * init_single_listen( int flag )
+{
+#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT
+ _single_accept = flag;
+ return NULL;
+#else
+ return "Single Unserialized listen not compiled in";
+#endif
+}
+
+#define SAFE_ACCEPT(stmt) { \
+ if (_single_accept) { \
+ do {if(ap_listeners->next != ap_listeners) {stmt;}} while(0); \
+ } else { \
+ do {stmt;} while(0); \
+ }; \
+}
+
static void usage(char *bin)
{
char pad[MAX_STRING_LEN];
@@ -3705,6 +3813,15 @@
#ifdef USE_PTHREAD_SERIALIZED_ACCEPT
printf(" -D USE_PTHREAD_SERIALIZED_ACCEPT\n");
#endif
+#ifdef USE_OS2SEM_SERIALIZED_ACCEPT
+ printf(" -D USE_OS2SEM_SERIALIZED_ACCEPT\n");
+#endif
+#ifdef USE_TPF_CORE_SERIALIZED_ACCEPT
+ printf(" -D USE_TPF_CORE_SERIALIZED_ACCEPT\n");
+#endif
+#ifdef USE_NONE_SERIALIZED_ACCEPT
+ printf(" -D USE_NONE_SERIALIZED_ACCEPT\n");
+#endif
#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT
printf(" -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT\n");
#endif
@@ -3854,7 +3971,7 @@
/* needs to be done before we switch UIDs so we have permissions */
reopen_scoreboard(pchild);
- SAFE_ACCEPT(accept_mutex_child_init(pchild));
+ SAFE_ACCEPT((accept_mutex_child_init(pchild)));
set_group_privs();
#ifdef MPE
@@ -3952,7 +4069,7 @@
*/
/* Lock around "accept", if necessary */
- SAFE_ACCEPT(accept_mutex_on());
+ SAFE_ACCEPT((accept_mutex_on()));
for (;;) {
if (ap_listeners->next != ap_listeners) {
Index: src/support/htpasswd.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/support/htpasswd.c,v
retrieving revision 1.42
diff -u -r1.42 htpasswd.c
--- src/support/htpasswd.c 2000/06/01 23:42:33 1.42
+++ src/support/htpasswd.c 2001/06/20 23:19:32
@@ -194,7 +194,7 @@
#else
if (ap_getpass("New password: ", pwin, sizeof(pwin)) != 0) {
ap_snprintf(record, (rlen - 1), "password too long (>%d)",
- sizeof(pwin) - 1);
+ (float) sizeof(pwin) - 1);
return ERR_OVERFLOW;
}
ap_getpass("Re-type new password: ", pwv, sizeof(pwv));