summaryrefslogtreecommitdiff
path: root/packages/libetpan/libetpan-0.36/reentrant.patch
blob: eaf1edfe22b58af26fd525ec65cea919f01a6061 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

#
# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
#

--- libetpan/src/data-types/mailsem.c~reentrant	2005-01-28 02:43:11.000000000 +0100
+++ libetpan/src/data-types/mailsem.c	2005-03-10 14:32:31.717000768 +0100
@@ -34,7 +34,9 @@
  */
 
 #include "mailsem.h"
+#ifdef LIBETPAN_REENTRANT
 #include <semaphore.h>
+#endif
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/stat.h>
@@ -50,6 +52,7 @@
 
 struct mailsem * mailsem_new(void)
 {
+#ifdef LIBETPAN_REENTRANT
   struct mailsem * sem;
   int r;
   
@@ -82,11 +85,13 @@
   return sem;
   
  err:
+#endif
   return NULL;
 }
 
 void mailsem_free(struct mailsem * sem)
 {
+#ifdef LIBETPAN_REENTRANT
   if (sem->sem_kind == SEMKIND_SEMOPEN) {
     char name[SEMNAME_LEN];
     
@@ -101,14 +106,23 @@
     free(sem->sem_sem);
   }
   free(sem);
+#endif
 }
 
 int mailsem_up(struct mailsem * sem)
 {
+#ifdef LIBETPAN_REENTRANT
   return sem_wait((sem_t *) sem->sem_sem);
+#else
+  return 0;
+#endif
 }
 
 int mailsem_down(struct mailsem * sem)
 {
+#ifdef LIBETPAN_REENTRANT
   return sem_post((sem_t *) sem->sem_sem);
+#else
+  return 0;
+#endif
 }