summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-22 19:09:01 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-22 19:12:07 +0900
commit4da1081c4d657f9dcf63dbe54a12be738b66a968 (patch)
tree0e0b311fbefac49e54070fabb606ddd9f53db257 /src/lib/ecore_drm/ecore_drm.c
parent4de2059d41e3e99efa4ab8399994dbd8f46fd67b (diff)
drm - shut up warnings (not actual bugs)
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm.c')
-rw-r--r--src/lib/ecore_drm/ecore_drm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/ecore_drm/ecore_drm.c b/src/lib/ecore_drm/ecore_drm.c
index 73585f494a..42f526854d 100644
--- a/src/lib/ecore_drm/ecore_drm.c
+++ b/src/lib/ecore_drm/ecore_drm.c
@@ -116,6 +116,7 @@ _ecore_drm_socket_send(int opcode, int fd, void *data, size_t bytes)
116 struct iovec iov[2]; 116 struct iovec iov[2];
117 struct msghdr msg; 117 struct msghdr msg;
118 ssize_t size; 118 ssize_t size;
119 int *iptr;
119 120
120 /* Simplified version of sending messages. We don't need to send any 121 /* Simplified version of sending messages. We don't need to send any
121 * 'credentials' with this as it is just basically an IPC to send over 122 * 'credentials' with this as it is just basically an IPC to send over
@@ -147,10 +148,9 @@ _ecore_drm_socket_send(int opcode, int fd, void *data, size_t bytes)
147 msg.msg_control = cmsgptr; 148 msg.msg_control = cmsgptr;
148 msg.msg_controllen = RIGHTS_LEN; 149 msg.msg_controllen = RIGHTS_LEN;
149 150
150 if (fd > -1) 151 iptr = (int *)(CMSG_DATA(cmsgptr));
151 *((int *)CMSG_DATA(cmsgptr)) = fd; 152 if (fd > -1) *iptr = fd;
152 else 153 else *iptr = _ecore_drm_sockets[1];
153 *((int *)CMSG_DATA(cmsgptr)) = _ecore_drm_sockets[1];
154 154
155 errno = 0; 155 errno = 0;
156 size = sendmsg(_ecore_drm_sockets[1], &msg, MSG_EOR); 156 size = sendmsg(_ecore_drm_sockets[1], &msg, MSG_EOR);
@@ -173,6 +173,7 @@ _ecore_drm_socket_receive(int opcode EINA_UNUSED, int *fd, void **data, size_t b
173 struct iovec iov[2]; 173 struct iovec iov[2];
174 struct msghdr msg; 174 struct msghdr msg;
175 char buff[CMSG_SPACE(sizeof(fd))]; 175 char buff[CMSG_SPACE(sizeof(fd))];
176 int *iptr;
176 /* ssize_t size; */ 177 /* ssize_t size; */
177 178
178 memset(&dmsg, 0, sizeof(dmsg)); 179 memset(&dmsg, 0, sizeof(dmsg));
@@ -212,7 +213,8 @@ _ecore_drm_socket_receive(int opcode EINA_UNUSED, int *fd, void **data, size_t b
212 switch (cmsg->cmsg_type) 213 switch (cmsg->cmsg_type)
213 { 214 {
214 case SCM_RIGHTS: 215 case SCM_RIGHTS:
215 if (fd) *fd = *((int *)CMSG_DATA(cmsg)); 216 iptr = (int *)(CMSG_DATA(cmsg));
217 if (fd) *fd = *iptr;
216 switch (dmsg.opcode) 218 switch (dmsg.opcode)
217 { 219 {
218 case ECORE_DRM_OP_DEVICE_OPEN: 220 case ECORE_DRM_OP_DEVICE_OPEN: