/[pkgs]/devel/ElectricFence/ElectricFence-2.2.2-pthread.patch
ViewVC logotype

Contents of /devel/ElectricFence/ElectricFence-2.2.2-pthread.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Thu Sep 9 02:30:08 2004 UTC (5 years, 2 months ago) by cvsdist
Branch: MAIN
CVS Tags: F-12-split, F-7-split, FC-5-split, ElectricFence-2_2_2-25_fc9, RHL-9-split, F-10-split, RHEL-3-split, F-11-split, RHL-8-split, ElectricFence-2_2_2-25, ElectricFence-2_2_2-22, ElectricFence-2_2_2-23, ElectricFence-2_2_2-20, ElectricFence-2_2_2-26_fc11, F-9-split, RHEL-4-split, FC-6-split, F-8-split, FC-3-split, FC-1-split, ElectricFence-2_2_2-20_1, ElectricFence-2_2_2-27_fc12, ElectricFence-2_2_2-17_1, ElectricFence-2_2_2-20_2, present-on-devel, FC-4-split, FC-2-split, ElectricFence-2_2_2-19, ElectricFence-2_2_2-18, ElectricFence-2_2_2-16, ElectricFence-2_2_2-15, ElectricFence-2_2_2-20_2_1, ElectricFence-2_2_2-20_2_2, HEAD
File MIME type: text/x-patch
auto-import changelog data from ElectricFence-2.2.2-15.src.rpm
* Mon Feb 03 2003 Jakub Jelinek <jakub@redhat.com>
- never call semaphore routines in between
  __libc_malloc_pthread_startup(true) and
  __libc_malloc_pthread_startup(false) (#83111)
- only use semaphore locking if application or its dependencies
  are linked against -lpthread, don't link libefence.so against
  -lpthread
- run tests as part of the build process

* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Tue Jan 07 2003 Jeff Johnson <jbj@redhat.com> 2.2.2-13
- don't include -debuginfo files in package.

* Thu Dec 12 2002 Tim Powers <timp@redhat.com> 2.2.2-12
- rebuild on all arches
1 --- ElectricFence-2.2.2/efence.c.jj 1999-04-12 21:00:49.000000000 -0400
2 +++ ElectricFence-2.2.2/efence.c 2003-02-03 11:20:18.000000000 -0500
3 @@ -174,6 +174,15 @@ static int internalUse = 0;
4 static int noAllocationListProtection = 0;
5
6 #ifdef USE_SEMAPHORE
7 +
8 +#include <stdbool.h>
9 +
10 +#pragma weak sem_init
11 +#pragma weak sem_post
12 +#pragma weak sem_wait
13 +
14 +static int pthread_initialization = 0;
15 +
16 /*
17 * EF_sem is a semaphore used to allow one thread at a time into
18 * these routines.
19 @@ -274,7 +283,7 @@ initialize(void)
20 EF_Print(version);
21
22 #ifdef USE_SEMAPHORE
23 - if (sem_init(&EF_sem, 0, 1) >= 0) {
24 + if (sem_init != NULL && !pthread_initialization && sem_init(&EF_sem, 0, 1) >= 0) {
25 semEnabled = 1;
26 }
27 #endif
28 @@ -397,6 +406,21 @@ initialize(void)
29 release();
30 }
31
32 +#ifdef USE_SEMAPHORE
33 +void
34 +__libc_malloc_pthread_startup (bool first_time)
35 +{
36 + if (first_time) {
37 + pthread_initialization = 1;
38 + initialize ();
39 + } else {
40 + pthread_initialization = 0;
41 + if (!semEnabled && sem_init != NULL && sem_init(&EF_sem, 0, 1) >= 0)
42 + semEnabled = 1;
43 + }
44 +}
45 +#endif
46 +
47 /*
48 * allocateMoreSlots is called when there are only enough slot structures
49 * left to support the allocation of a single malloc buffer.
50 --- ElectricFence-2.2.2/Makefile.jj 1999-04-13 13:22:49.000000000 -0400
51 +++ ElectricFence-2.2.2/Makefile 2003-02-03 11:27:06.000000000 -0500
52 @@ -1,6 +1,6 @@
53 PIC= -fPIC
54 CFLAGS= -g -DUSE_SEMAPHORE $(PIC)
55 -LIBS= -lpthread
56 +LIBS=
57
58 prefix=/usr
59 BIN_INSTALL_DIR= $(prefix)/bin
60 @@ -54,8 +54,8 @@ libefence.a: $(OBJECTS)
61 $(AR) crv libefence.a $(OBJECTS)
62
63 libefence.so.0.0: $(OBJECTS)
64 - gcc -g -shared -Wl,-soname,libefence.so.0 -o libefence.so.0.0 \
65 - $(OBJECTS) -lpthread -lc
66 + gcc -shared -Wl,-soname,libefence.so.0 -o libefence.so.0.0 \
67 + $(CFLAGS) $(OBJECTS)
68
69 tstheap: libefence.a tstheap.o
70 - rm -f tstheap

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2