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
|
$NetBSD: patch-aa,v 1.1 2004/07/18 20:28:23 kristerw Exp $
--- src/osip2/port_sema.c.orig Sun Jul 18 21:08:34 2004
+++ src/osip2/port_sema.c Sun Jul 18 21:09:32 2004
@@ -133,7 +133,6 @@
struct osip_sem *
osip_sem_init (unsigned int value)
{
- union semun val;
int i;
osip_sem_t *sem = (osip_sem_t *) osip_malloc (sizeof (osip_sem_t));
@@ -144,8 +143,7 @@
osip_free (sem);
return NULL;
}
- val.val = (int) value;
- i = semctl (sem->semid, 0, SETVAL, val);
+ i = semctl (sem->semid, 0, SETVAL, value);
if (i != 0)
{
perror ("semctl error");
@@ -158,12 +156,10 @@
int
osip_sem_destroy (struct osip_sem *_sem)
{
- union semun val;
osip_sem_t *sem = (osip_sem_t *) _sem;
if (sem == NULL)
return 0;
- val.val = 0;
- semctl (sem->semid, 0, IPC_RMID, val);
+ semctl (sem->semid, 0, IPC_RMID, 0);
osip_free (sem);
return 0;
}
|