1
===================================================================
2
RCS file: /cvs/lvm2/LVM2/libdm/libdm-common.c,v
3
retrieving revision 1.95
4
retrieving revision 1.96
6
--- LVM2/libdm/libdm-common.c 2010/05/03 21:06:53 1.95
7
+++ LVM2/libdm/libdm-common.c 2010/05/27 15:02:56 1.96
10
#define DEV_DIR "/dev/"
12
+#ifdef UDEV_SYNC_SUPPORT
13
+#ifdef _SEM_SEMUN_UNDEFINED
16
+ int val; /* value for SETVAL */
17
+ struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
18
+ unsigned short int *array; /* array for GETALL & SETALL */
19
+ struct seminfo *__buf; /* buffer for IPC_INFO */
24
static char _dm_dir[PATH_MAX] = DEV_DIR DM_DIR;
26
static int _verbose = 0;
31
+ union semun sem_arg;
33
if ((fd = open("/dev/urandom", O_RDONLY)) < 0) {
34
log_error("Failed to open /dev/urandom "
36
log_debug("Udev cookie 0x%" PRIx32 " (semid %d) created",
37
gen_cookie, gen_semid);
39
- if (semctl(gen_semid, 0, SETVAL, 1) < 0) {
42
+ if (semctl(gen_semid, 0, SETVAL, sem_arg) < 0) {
43
log_error("semid %d: semctl failed: %s", gen_semid, strerror(errno));
44
/* We have to destroy just created semaphore
45
* so it won't stay in the system. */