diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-09-12 08:25:06 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-09-12 08:25:06 -0300 |
commit | 53e172752152ab9dc011210e6aacd0fbb8e6ad4e (patch) | |
tree | 95ca4c0d7a3ea167433d945fa8da8908a47a37cb | |
parent | 7f937d31ac2af7416c60cd5ff7b5153c85e23d3a (diff) |
dvb-dev-local: fix pthread checks
If there's no pthread at all, it doesn't make sense to include
pthread.h, nor to use pthread_t typedef.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | lib/libdvbv5/dvb-dev-local.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c index ce6504b5..920e81fb 100644 --- a/lib/libdvbv5/dvb-dev-local.c +++ b/lib/libdvbv5/dvb-dev-local.c @@ -24,12 +24,15 @@ #include <stdio.h> #include <stdlib.h> #include <locale.h> -#include <pthread.h> #include <unistd.h> #include <string.h> #include <config.h> +#ifdef HAVE_PTHREAD +# include <pthread.h> +#endif + #include "dvb-fe-priv.h" #include "dvb-dev-priv.h" @@ -44,7 +47,9 @@ struct dvb_dev_local_priv { dvb_dev_change_t notify_dev_change; +#ifdef HAVE_PTHREAD pthread_t dev_change_id; +#endif /* udev control fields */ int udev_fd; @@ -294,12 +299,13 @@ static int dvb_local_find(struct dvb_device_priv *dvb, #ifndef HAVE_PTHREAD dvb_logerr("Need to be compiled with pthreads for monitor"); return -EINVAL; -#endif +#else /* Set up a monitor to monitor dvb devices */ priv->mon = udev_monitor_new_from_netlink(priv->udev, "udev"); udev_monitor_filter_add_match_subsystem_devtype(priv->mon, "dvb", NULL); udev_monitor_enable_receiving(priv->mon); priv->udev_fd = udev_monitor_get_fd(priv->mon); +#endif } /* Create a list of the devices in the 'dvb' subsystem. */ |