|
|
f20720 |
---
|
|
|
f20720 |
libmultipath/uevent.c | 12 ++++--------
|
|
|
f20720 |
1 file changed, 4 insertions(+), 8 deletions(-)
|
|
|
f20720 |
|
|
|
f20720 |
Index: multipath-tools-130222/libmultipath/uevent.c
|
|
|
f20720 |
===================================================================
|
|
|
f20720 |
--- multipath-tools-130222.orig/libmultipath/uevent.c
|
|
|
f20720 |
+++ multipath-tools-130222/libmultipath/uevent.c
|
|
|
f20720 |
@@ -53,8 +53,10 @@ typedef int (uev_trigger)(struct uevent
|
|
|
f20720 |
|
|
|
f20720 |
pthread_t uevq_thr;
|
|
|
f20720 |
LIST_HEAD(uevq);
|
|
|
f20720 |
-pthread_mutex_t uevq_lock, *uevq_lockp = &uevq_lock;
|
|
|
f20720 |
-pthread_cond_t uev_cond, *uev_condp = &uev_cond;
|
|
|
f20720 |
+pthread_mutex_t uevq_lock = PTHREAD_MUTEX_INITIALIZER;
|
|
|
f20720 |
+pthread_mutex_t *uevq_lockp = &uevq_lock;
|
|
|
f20720 |
+pthread_cond_t uev_cond = PTHREAD_COND_INITIALIZER;
|
|
|
f20720 |
+pthread_cond_t *uev_condp = &uev_cond;
|
|
|
f20720 |
uev_trigger *my_uev_trigger;
|
|
|
f20720 |
void * my_trigger_data;
|
|
|
f20720 |
int servicing_uev;
|
|
|
f20720 |
@@ -409,10 +411,6 @@ int uevent_listen(void)
|
|
|
f20720 |
* thereby not getting to empty the socket's receive buffer queue
|
|
|
f20720 |
* often enough.
|
|
|
f20720 |
*/
|
|
|
f20720 |
- INIT_LIST_HEAD(&uevq);
|
|
|
f20720 |
-
|
|
|
f20720 |
- pthread_mutex_init(uevq_lockp, NULL);
|
|
|
f20720 |
- pthread_cond_init(uev_condp, NULL);
|
|
|
f20720 |
pthread_cleanup_push(uevq_stop, NULL);
|
|
|
f20720 |
|
|
|
f20720 |
monitor = udev_monitor_new_from_netlink(conf->udev, "udev");
|
|
|
f20720 |
@@ -525,8 +523,6 @@ out:
|
|
|
f20720 |
if (need_failback)
|
|
|
f20720 |
err = failback_listen();
|
|
|
f20720 |
pthread_cleanup_pop(1);
|
|
|
f20720 |
- pthread_mutex_destroy(uevq_lockp);
|
|
|
f20720 |
- pthread_cond_destroy(uev_condp);
|
|
|
f20720 |
return err;
|
|
|
f20720 |
}
|
|
|
f20720 |
|