aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libdvbv5/dvb-dev-local.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2018-03-19 12:30:41 (GMT)
committerSakari Ailus <sakari.ailus@linux.intel.com>2018-04-26 13:39:32 (GMT)
commit03e763fd4b361b2082019032fc315b7606669335 (patch)
tree7a720eaa30ad9a62c9280d7e07b87c2e4ea91c07 /lib/libdvbv5/dvb-dev-local.c
parentecd7ee0bb26c96b3f7fc3fed4d377f2c192f80b0 (diff)
libdvb5: Fix unused local variable warnings
Some local variables are only needed conditionally depending on available system support for e.g. pthreads. Put these variables behind same #ifdefs so that no warnings are produced if these features aren't available. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'lib/libdvbv5/dvb-dev-local.c')
-rw-r--r--lib/libdvbv5/dvb-dev-local.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c
index 7a76d65..7ebf2b6 100644
--- a/lib/libdvbv5/dvb-dev-local.c
+++ b/lib/libdvbv5/dvb-dev-local.c
@@ -296,7 +296,6 @@ static int dvb_local_find(struct dvb_device_priv *dvb,
struct udev_enumerate *enumerate;
struct udev_list_entry *devices, *dev_list_entry;
struct udev_device *dev;
- int ret;
/* Free a previous list of devices */
if (dvb->d.num_devices)
@@ -346,6 +345,8 @@ static int dvb_local_find(struct dvb_device_priv *dvb,
/* Begin monitoring udev events */
#ifdef HAVE_PTHREAD
if (priv->notify_dev_change) {
+ int ret;
+
ret = pthread_create(&priv->dev_change_id, NULL,
monitor_device_changes, dvb);
if (ret < 0) {
@@ -364,9 +365,9 @@ static int dvb_local_find(struct dvb_device_priv *dvb,
static int dvb_local_stop_monitor(struct dvb_device_priv *dvb)
{
+#ifdef HAVE_PTHREAD
struct dvb_dev_local_priv *priv = dvb->priv;
-#ifdef HAVE_PTHREAD
if (priv->notify_dev_change) {
pthread_cancel(priv->dev_change_id);
udev_unref(priv->udev);

Privacy Policy