You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dg...@hyperreal.org on 1997/12/12 09:09:21 UTC
cvs commit: apachen/src/main http_main.c
dgaudet 97/12/12 00:09:21
Modified: src CHANGES
src/main http_main.c
Log:
The pthread_mutex_ functions do not set errno, they return an errno
value. I'm committing this because it was posted on nov 20, and I'm
tired of it sitting in my tree uncommitted.
Submitted by: Igor Tatarinov <ta...@prairie.NoDak.edu>
Reviewed by: Dean Gaudet
Revision Changes Path
1.525 +3 -0 apachen/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apachen/src/CHANGES,v
retrieving revision 1.524
retrieving revision 1.525
diff -u -r1.524 -r1.525
--- CHANGES 1997/12/07 21:49:52 1.524
+++ CHANGES 1997/12/12 08:09:17 1.525
@@ -1,5 +1,8 @@
Changes with Apache 1.3b4
+ *) The pthread_mutex_* functions return an error code, and don't
+ set errno. [Igor Tatarinov <ta...@prairie.NoDak.edu>]
+
*) WIN32: Allow spaces to prefix the interpreter in #! lines.
[Ben Laurie] PR#1101
1.256 +12 -5 apachen/src/main/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
retrieving revision 1.255
retrieving revision 1.256
diff -u -r1.255 -r1.256
--- http_main.c 1997/11/25 20:43:32 1.255
+++ http_main.c 1997/12/12 08:09:19 1.256
@@ -394,15 +394,16 @@
exit(1);
}
close(fd);
- if (pthread_mutexattr_init(&mattr)) {
+ if ((errno = pthread_mutexattr_init(&mattr))) {
perror("pthread_mutexattr_init");
exit(1);
}
- if (pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED)) {
+ if ((errno = pthread_mutexattr_setpshared(&mattr,
+ PTHREAD_PROCESS_SHARED))) {
perror("pthread_mutexattr_setpshared");
exit(1);
}
- if (pthread_mutex_init(accept_mutex, &mattr)) {
+ if ((errno = pthread_mutex_init(accept_mutex, &mattr))) {
perror("pthread_mutex_init");
exit(1);
}
@@ -415,11 +416,14 @@
static void accept_mutex_on()
{
+ int err;
+
if (sigprocmask(SIG_BLOCK, &accept_block_mask, &accept_previous_mask)) {
perror("sigprocmask(SIG_BLOCK)");
exit (1);
}
- if (pthread_mutex_lock(accept_mutex)) {
+ if ((err = pthread_mutex_lock(accept_mutex))) {
+ errno = err;
perror("pthread_mutex_lock");
exit(1);
}
@@ -428,7 +432,10 @@
static void accept_mutex_off()
{
- if (pthread_mutex_unlock(accept_mutex)) {
+ int err;
+
+ if ((err = pthread_mutex_unlock(accept_mutex))) {
+ errno = err;
perror("pthread_mutex_unlock");
exit(1);
}