1 |
vip-ire |
1.2 |
diff -Nur buffer-1.19/sem.c buffer-1.19_buffer-1.19/sem.c |
2 |
|
|
--- buffer-1.19/sem.c 2016-02-07 20:07:23.016441596 +0100 |
3 |
|
|
+++ buffer-1.19_buffer-1.19/sem.c 2016-02-07 20:09:39.850435663 +0100 |
4 |
stephdl |
1.1 |
@@ -28,13 +28,14 @@ |
5 |
|
|
|
6 |
|
|
#include <stdio.h> |
7 |
|
|
#include <sys/types.h> |
8 |
|
|
+#include <unistd.h> |
9 |
|
|
#include <sys/stat.h> |
10 |
|
|
#include <sys/ipc.h> |
11 |
|
|
#include <sys/sem.h> |
12 |
|
|
#include <errno.h> |
13 |
|
|
#include "sem.h" |
14 |
|
|
|
15 |
|
|
-#if defined(SYS5) || defined(ultrix) || defined(_AIX) |
16 |
|
|
+#if defined(SYS5) || defined(ultrix) || defined(_AIX) || defined _SEM_SEMUN_UNDEFINED |
17 |
|
|
union semun { |
18 |
|
|
int val; |
19 |
|
|
struct semid_ds *buf; |
20 |
|
|
@@ -95,7 +96,7 @@ |
21 |
|
|
return sem; |
22 |
|
|
} |
23 |
|
|
|
24 |
|
|
-static |
25 |
|
|
+static void |
26 |
|
|
do_sem( sem_id, pbuf, err ) |
27 |
|
|
int sem_id; |
28 |
|
|
struct sembuf *pbuf; |
29 |
|
|
@@ -152,7 +153,7 @@ |
30 |
|
|
if( sem_id == -1 ) |
31 |
|
|
return; |
32 |
|
|
|
33 |
|
|
- if( semctl( sem_id, 0, IPC_RMID, NULL ) == -1 ){ |
34 |
|
|
+ if( semctl( sem_id, 0, IPC_RMID, (union semun) 0 ) == -1 ){ |
35 |
|
|
report_proc(); |
36 |
|
|
perror( "internal error, failed to remove semaphore" ); |
37 |
|
|
} |