~ubuntu-branches/ubuntu/quantal/lvm2/quantal

« back to all changes in this revision

Viewing changes to debian/patches/upstream-define-union-semun.patch

  • Committer: Steve Langasek
  • Date: 2012-04-14 02:57:53 UTC
  • mfrom: (3.1.22 sid)
  • Revision ID: steve.langasek@canonical.com-20120414025753-ejbdw9c8llik58y9
Merge version 2.02.88-2 from Debian testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
===================================================================
2
 
RCS file: /cvs/lvm2/LVM2/libdm/libdm-common.c,v
3
 
retrieving revision 1.95
4
 
retrieving revision 1.96
5
 
diff -u -r1.95 -r1.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
8
 
@@ -43,6 +43,18 @@
9
 
 
10
 
 #define DEV_DIR "/dev/"
11
 
 
12
 
+#ifdef UDEV_SYNC_SUPPORT
13
 
+#ifdef _SEM_SEMUN_UNDEFINED
14
 
+union semun
15
 
+{
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 */
20
 
+};
21
 
+#endif
22
 
+#endif
23
 
+
24
 
 static char _dm_dir[PATH_MAX] = DEV_DIR DM_DIR;
25
 
 
26
 
 static int _verbose = 0;
27
 
@@ -1076,6 +1088,7 @@
28
 
        int gen_semid;
29
 
        uint16_t base_cookie;
30
 
        uint32_t gen_cookie;
31
 
+       union semun sem_arg;
32
 
 
33
 
        if ((fd = open("/dev/urandom", O_RDONLY)) < 0) {
34
 
                log_error("Failed to open /dev/urandom "
35
 
@@ -1123,7 +1136,9 @@
36
 
        log_debug("Udev cookie 0x%" PRIx32 " (semid %d) created",
37
 
                  gen_cookie, gen_semid);
38
 
 
39
 
-       if (semctl(gen_semid, 0, SETVAL, 1) < 0) {
40
 
+       sem_arg.val = 1;
41
 
+
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. */