summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_tty.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-04-24 12:51:34 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-04-24 12:53:01 -0400
commit3d71a10891c31de9c667f15f8f37371a5664f759 (patch)
treecc2ff822e9ffa1636ad284d6b3beb8c74146cac6 /src/lib/ecore_drm/ecore_drm_tty.c
parenta01b2434054db1f7de9087634227c52abb48e291 (diff)
ecore-drm: add safety checks to all EAPI functions
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_tty.c')
-rw-r--r--src/lib/ecore_drm/ecore_drm_tty.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_tty.c b/src/lib/ecore_drm/ecore_drm_tty.c
index e7f394d2fb..b21773d019 100644
--- a/src/lib/ecore_drm/ecore_drm_tty.c
+++ b/src/lib/ecore_drm/ecore_drm_tty.c
@@ -135,7 +135,7 @@ ecore_drm_tty_open(Ecore_Drm_Device *dev, const char *name)
135 char tty[32] = "<stdin>"; 135 char tty[32] = "<stdin>";
136 136
137 /* check for valid device */ 137 /* check for valid device */
138 if ((!dev) || (!dev->drm.name)) return EINA_FALSE; 138 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name), EINA_FALSE);
139 139
140 /* assign default tty fd of -1 */ 140 /* assign default tty fd of -1 */
141 dev->tty.fd = -1; 141 dev->tty.fd = -1;
@@ -226,7 +226,7 @@ EAPI Eina_Bool
226ecore_drm_tty_close(Ecore_Drm_Device *dev) 226ecore_drm_tty_close(Ecore_Drm_Device *dev)
227{ 227{
228 /* check for valid device */ 228 /* check for valid device */
229 if ((!dev) || (!dev->drm.name)) return EINA_FALSE; 229 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name), EINA_FALSE);
230 230
231 _ecore_drm_tty_restore(dev); 231 _ecore_drm_tty_restore(dev);
232 232
@@ -247,7 +247,7 @@ EAPI Eina_Bool
247ecore_drm_tty_release(Ecore_Drm_Device *dev) 247ecore_drm_tty_release(Ecore_Drm_Device *dev)
248{ 248{
249 /* check for valid device */ 249 /* check for valid device */
250 if ((!dev) || (!dev->drm.name) || (dev->tty.fd < 0)) return EINA_FALSE; 250 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name) || (dev->tty.fd < 0), EINA_FALSE);
251 251
252 /* send ioctl for vt release */ 252 /* send ioctl for vt release */
253 if (ioctl(dev->tty.fd, VT_RELDISP, 1) < 0) 253 if (ioctl(dev->tty.fd, VT_RELDISP, 1) < 0)
@@ -263,7 +263,7 @@ EAPI Eina_Bool
263ecore_drm_tty_acquire(Ecore_Drm_Device *dev) 263ecore_drm_tty_acquire(Ecore_Drm_Device *dev)
264{ 264{
265 /* check for valid device */ 265 /* check for valid device */
266 if ((!dev) || (!dev->drm.name) || (dev->tty.fd < 0)) return EINA_FALSE; 266 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name) || (dev->tty.fd < 0), EINA_FALSE);
267 267
268 /* send ioctl for vt acquire */ 268 /* send ioctl for vt acquire */
269 if (ioctl(dev->tty.fd, VT_RELDISP, VT_ACKACQ) < 0) 269 if (ioctl(dev->tty.fd, VT_RELDISP, VT_ACKACQ) < 0)
@@ -279,7 +279,7 @@ EAPI int
279ecore_drm_tty_get(Ecore_Drm_Device *dev) 279ecore_drm_tty_get(Ecore_Drm_Device *dev)
280{ 280{
281 /* check for valid device */ 281 /* check for valid device */
282 if ((!dev) || (!dev->drm.name) || (dev->tty.fd < 0)) return -1; 282 EINA_SAFETY_ON_TRUE_RETURN_VAL((!dev) || (!dev->drm.name) || (dev->tty.fd < 0), -1);
283 283
284 return dev->tty.fd; 284 return dev->tty.fd;
285} 285}