summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-09-30 08:38:57 -0400
committerChris Michael <cp.michael@samsung.com>2014-09-30 08:38:57 -0400
commit1175bb47b991243bc744c12f9144c6ce281c8cfc (patch)
treedec286552ecf0c6802804f8d25c2d54291b71bc0 /src/lib/eeze
parent5eac1ebf28e7dacb7b29787610f69ae67814d775 (diff)
eeze: Add ifdef trap for older udev version
Summary: This adds an ifdef trap for older versions of libudev which do not provide udev_device_set_sysattr_value function. This fixes broken EFL compile with older versions of udev. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/eeze_udev_syspath.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/eeze/eeze_udev_syspath.c b/src/lib/eeze/eeze_udev_syspath.c
index cd4a6e0778..d22a7e5ff9 100644
--- a/src/lib/eeze/eeze_udev_syspath.c
+++ b/src/lib/eeze/eeze_udev_syspath.c
@@ -206,9 +206,7 @@ eeze_udev_syspath_set_sysattr(const char *syspath,
206 double value) 206 double value)
207{ 207{
208 _udev_device *device; 208 _udev_device *device;
209 char val[16];
210 Eina_Bool ret = EINA_FALSE; 209 Eina_Bool ret = EINA_FALSE;
211 int test;
212 210
213 if (!syspath || !sysattr) 211 if (!syspath || !sysattr)
214 return EINA_FALSE; 212 return EINA_FALSE;
@@ -216,10 +214,15 @@ eeze_udev_syspath_set_sysattr(const char *syspath,
216 if (!(device = _new_device(syspath))) 214 if (!(device = _new_device(syspath)))
217 return EINA_FALSE; 215 return EINA_FALSE;
218 216
217#ifndef OLD_LIBUDEV
218 char val[16];
219 int test;
220
219 sprintf(val, "%f", value); 221 sprintf(val, "%f", value);
220 test = udev_device_set_sysattr_value(device, sysattr, val); 222 test = udev_device_set_sysattr_value(device, sysattr, val);
221 if (test == 0) 223 if (test == 0)
222 ret = EINA_TRUE; 224 ret = EINA_TRUE;
225#endif
223 226
224 udev_device_unref(device); 227 udev_device_unref(device);
225 return ret; 228 return ret;