along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <tevent.h>
-
#include "replace.h"
#include "system/network.h"
+#include <tevent.h>
+
#include "lib/util/debug.h"
#include "lib/util/time.h"
#include "lib/util/strv.h"
#include "lib/util/strv_util.h"
+#include "lib/util/sys_rw.h"
+#include "lib/util/blocking.h"
#include "ctdb_private.h"
#include "common/common.h"
#include "common/logging.h"
-#include "common/system.h"
#include "ctdb_cluster_mutex.h"
struct ctdb_context *ctdb;
cluster_mutex_handler_t handler;
void *private_data;
+ cluster_mutex_lost_handler_t lost_handler;
+ void *lost_data;
int fd[2];
struct tevent_timer *te;
struct tevent_fd *fde;
/* Don't call the handler more than once. It only exists to
* process the initial response from the helper. */
if (h->have_response) {
+ /* Only deal with EOF due to process exit. Silently
+ * ignore any other output. */
+ if (ret == 0) {
+ if (h->lost_handler != NULL) {
+ h->lost_handler(h->lost_data);
+ }
+ }
return;
}
h->have_response = true;
const char *argstring,
int timeout,
cluster_mutex_handler_t handler,
- void *private_data)
+ void *private_data,
+ cluster_mutex_lost_handler_t lost_handler,
+ void *lost_data)
{
struct ctdb_cluster_mutex_handle *h;
char **args;
h->ctdb = ctdb;
h->handler = handler;
h->private_data = private_data;
+ h->lost_handler = lost_handler;
+ h->lost_data = lost_data;
return h;
}