38 lines
944 B
Diff
38 lines
944 B
Diff
diff -Nur buffer-1.19/sem.c buffer-1.19_buffer-1.19/sem.c
|
|
--- buffer-1.19/sem.c 2016-02-07 20:07:23.016441596 +0100
|
|
+++ buffer-1.19_buffer-1.19/sem.c 2016-02-07 20:09:39.850435663 +0100
|
|
@@ -28,13 +28,14 @@
|
|
|
|
#include <stdio.h>
|
|
#include <sys/types.h>
|
|
+#include <unistd.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/ipc.h>
|
|
#include <sys/sem.h>
|
|
#include <errno.h>
|
|
#include "sem.h"
|
|
|
|
-#if defined(SYS5) || defined(ultrix) || defined(_AIX)
|
|
+#if defined(SYS5) || defined(ultrix) || defined(_AIX) || defined _SEM_SEMUN_UNDEFINED
|
|
union semun {
|
|
int val;
|
|
struct semid_ds *buf;
|
|
@@ -95,7 +96,7 @@
|
|
return sem;
|
|
}
|
|
|
|
-static
|
|
+static void
|
|
do_sem( sem_id, pbuf, err )
|
|
int sem_id;
|
|
struct sembuf *pbuf;
|
|
@@ -152,7 +153,7 @@
|
|
if( sem_id == -1 )
|
|
return;
|
|
|
|
- if( semctl( sem_id, 0, IPC_RMID, NULL ) == -1 ){
|
|
+ if( semctl( sem_id, 0, IPC_RMID, (union semun) 0 ) == -1 ){
|
|
report_proc();
|
|
perror( "internal error, failed to remove semaphore" );
|
|
}
|