Revert "Add mapper-wait-until-removed"

This reverts commit 9f4c3c7c408a5f84a52416da99d0dd8035f1ae5a.

After further design discussions, the new wait until
removed implementation should be a new API. Reverting this
change to put back the original wait interfaces since new
ones will be created instead of modifying the existing ones.

Change-Id: I605439dcb24c6dca7f394325afc6587eacf417f1
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/libmapper/mapper.c b/libmapper/mapper.c
index ad64d4a..962b4e0 100644
--- a/libmapper/mapper.c
+++ b/libmapper/mapper.c
@@ -35,11 +35,6 @@
 	"interface='org.freedesktop.DBus.ObjectManager',"
 	"member='InterfacesAdded'";
 
-static const char *async_wait_interfaces_removed_match =
-	"type='signal',"
-	"interface='org.freedesktop.DBus.ObjectManager',"
-	"member='InterfacesRemoved'";
-
 static const int mapper_busy_retries = 5;
 static const uint64_t mapper_busy_delay_interval_usec = 1000000;
 
@@ -56,7 +51,6 @@
 	int count;
 	int finished;
 	int r;
-	bool added;
 };
 
 struct async_wait_callback_data
@@ -163,12 +157,8 @@
 		goto exit;
 
 	r = sd_bus_message_get_errno(m);
-	if(r == ENOENT) {
-		if (wait->added)
-			goto exit;
-		else
-			r = 0;
-	}
+	if(r == ENOENT)
+		goto exit;
 
 	if(r == EBUSY && data->retry < mapper_busy_retries) {
 		r = sd_event_now(wait->loop,
@@ -306,8 +296,7 @@
 		char *objs[],
 		void (*callback)(int, void *),
 		void *userdata,
-		mapper_async_wait **w,
-		bool added)
+		mapper_async_wait **w)
 {
 	int r;
 	mapper_async_wait *wait = NULL;
@@ -324,7 +313,6 @@
 	wait->count = sarraylen(objs);
 	if(!wait->count)
 		return 0;
-	wait->added = added;
 
 	wait->objs = sarraydup(objs);
 	if(!wait->objs) {
@@ -339,39 +327,26 @@
 	}
 	memset(wait->status, 0, sizeof(*wait->status) * wait->count);
 
-	if (wait->added) {
-		r = sd_bus_add_match(conn,
-				&wait->introspection_slot,
-				async_wait_introspection_match,
-				async_wait_match_introspection_complete,
-				wait);
-		if(r < 0) {
-			fprintf(stderr, "Error adding match rule: %s\n",
-					strerror(-r));
-			goto free_status;
-		}
+	r = sd_bus_add_match(conn,
+			&wait->introspection_slot,
+			async_wait_introspection_match,
+			async_wait_match_introspection_complete,
+			wait);
+	if(r < 0) {
+		fprintf(stderr, "Error adding match rule: %s\n",
+				strerror(-r));
+		goto free_status;
+	}
 
-		r = sd_bus_add_match(conn,
-				&wait->intf_slot,
-				async_wait_interfaces_added_match,
-				async_wait_match_introspection_complete,
-				wait);
-		if(r < 0) {
-			fprintf(stderr, "Error adding match rule: %s\n",
-					strerror(-r));
-			goto unref_name_slot;
-		}
-	} else {
-		r = sd_bus_add_match(conn,
-				&wait->intf_slot,
-				async_wait_interfaces_removed_match,
-				async_wait_match_introspection_complete,
-				wait);
-		if(r < 0) {
-			fprintf(stderr, "Error adding match rule: %s\n",
-					strerror(-r));
-			goto unref_name_slot;
-		}
+	r = sd_bus_add_match(conn,
+                        &wait->intf_slot,
+			async_wait_interfaces_added_match,
+                        async_wait_match_introspection_complete,
+                        wait);
+	if(r < 0) {
+		fprintf(stderr, "Error adding match rule: %s\n",
+				strerror(-r));
+		goto unref_name_slot;
 	}
 
 	r = async_wait_get_objects(wait);