+
+ /* If a directory entry already exists, return failure. The caller must
+ * delete the old entry and try again. TODO: We'll fail on a hash
+ * collision; we should handle that case. */
+ if (!g_sequence_iter_is_end(g_sequence_iter_prev(i))) {
+ BlueSkyDirent *d2 = g_sequence_get(g_sequence_iter_prev(i));
+ if (d2->hash == hash)
+ return FALSE;
+ }
+