+/*
+ * Duplicate the junction's parent's export options and graft in
+ * the fslocdata we constructed from the locations list.
+ *
+ * Returned exportent points to static memory.
+ */
+static struct exportent *create_junction_exportent(struct exportent *parent,
+ const char *junction, const char *fslocdata, int ttl)
+{
+ static struct exportent ee;
+
+ dupexportent(&ee, parent);
+ strcpy(ee.e_path, junction);
+ ee.e_hostname = strdup(parent->e_hostname);
+ if (ee.e_hostname == NULL)
+ goto out_nomem;
+ free(ee.e_uuid);
+ ee.e_uuid = NULL;
+ ee.e_ttl = (unsigned int)ttl;
+
+ free(ee.e_fslocdata);
+ ee.e_fslocmethod = FSLOC_REFER;
+ ee.e_fslocdata = strdup(fslocdata);
+ if (ee.e_fslocdata == NULL)
+ goto out_nomem;
+
+ return ⅇ
+
+out_nomem:
+ xlog(L_ERROR, "%s: No memory", __func__);
+ return NULL;
+}
+