summaryrefslogtreecommitdiff
path: root/net-mgmt/annextools/files/patch-erpcd::session_dbunx.c
blob: 03a1b2e266366c5b795540d514aebdfc96690da1 (plain) (blame)
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
--- erpcd/session_dbunx.c.orig	Wed Oct 15 13:50:46 1997
+++ erpcd/session_dbunx.c	Thu Sep 18 20:10:32 2003
@@ -117,7 +117,11 @@
 key_t sem_key = 0;          /* semaphore key */
 int Asemid;		/* Access semaphore id */
 
+#if defined(__FreeBSD__)
+int ctlinit;
+#else
 union semun ctlinit;	/* arg struct for semctl */
+#endif
 						/* sembuf elements: index, op, flag */
 struct sembuf sopwait = {0,-1, SEM_UNDO};	/* wait for semaphore */
 struct sembuf soppost = {0, 1, SEM_UNDO};	/* set value to available */
@@ -290,7 +294,11 @@
 	return errno;
       }
     }
+#if defined(__FreeBSD__)
+    ctlinit = 1;
+#else
     ctlinit.val = 1;
+#endif
     if (semctl(Asemid, 0, SETVAL, ctlinit) == -1) {
 #ifdef USE_SYSLOG
       syslog(LOG_CRIT, "%s: Set semaphore, semctl error %d. No database access.", appname, errno);