Index: uspace/srv/sysman/edge.c
===================================================================
--- uspace/srv/sysman/edge.c	(revision 9532981c809e6450c3fe6b10fecbed3683acb15c)
+++ uspace/srv/sysman/edge.c	(revision db344249b9e78f30d2f8cb89833fbc692a0606b5)
@@ -41,4 +41,15 @@
 }
 
+static unit_edge_t *edge_extract_internal(unit_t *input, unit_t *output)
+{
+	list_foreach(input->edges_out, edges_out, unit_edge_t, e) {
+		if (e->output == output) {
+			return e;
+		}
+	}
+
+	return NULL;
+}
+
 unit_edge_t *edge_create(void)
 {
@@ -68,6 +79,6 @@
 int edge_sprout_out(unit_t *input, const char *output_name)
 {
+	int rc;
 	unit_edge_t *e = edge_create();
-	int rc;
 
 	if (e == NULL) {
@@ -76,4 +87,5 @@
 	}
 
+	//TODO check multi-edges
 	e->output_name = str_dup(output_name);
 	if (e->output_name == NULL) {
@@ -94,11 +106,12 @@
 }
 
-void edge_resolve_output(unit_edge_t *e, unit_t *unit)
+void edge_resolve_output(unit_edge_t *e, unit_t *output)
 {
 	assert(e->output == NULL);
 	assert(e->output_name != NULL);
 
-	// TODO add to other side edges_in list
-	e->output = unit;
+	e->output = output;
+	list_append(&e->edges_in, output->edges_id);
+
 	free(e->output_name);
 	e->output_name = NULL;
@@ -109,7 +122,12 @@
  * @return        EOK on success
  * @return        ENOMEM
+ * @return        EEXISTS
  */
 int edge_connect(unit_t *input, unit_t *output)
 {
+	if (edge_extract_internal(input, output)) {
+		return EEXISTS;
+	}
+
 	unit_edge_t *e = edge_create();
 	if (e == NULL) {
@@ -117,7 +135,4 @@
 	}
 
-	// TODO check existence of the e
-	// TODO locking
-	// TODO check types and states of connected units
 	list_append(&e->edges_in, &output->edges_in);
 	list_append(&e->edges_out, &input->edges_out);
@@ -128,12 +143,14 @@
 }
 
-/** Remove output from output graph
+/** Remove edge from dependency graph
  *
- * Given output is removed from graph and unallocated.
+ * Given edge is removed from graph and unallocated.
  */
 void edge_remove(unit_edge_t **e_ptr)
 {
-	// TODO here should be some checks, othewise replace this wrapper with
-	//      direct destroy
+	/*
+	 * So far it's just passing, however, edge_destroy is considered
+	 * low-level and edge_remove could later e.g. support transactions.
+	 */
 	edge_destroy(e_ptr);
 }
