diff --git a/rhizome.h b/rhizome.h index 4da31913..ab3ceb9a 100644 --- a/rhizome.h +++ b/rhizome.h @@ -187,9 +187,6 @@ const char *rhizome_datastore_path(); int form_rhizome_datastore_path(char * buf, size_t bufsiz, const char *fmt, ...); int create_rhizome_datastore_dir(); -int form_rhizome_import_path(char * buf, size_t bufsiz, const char *fmt, ...); -int create_rhizome_import_dir(); - /* Handy statement for forming the path of a rhizome store file in a char buffer whose declaration * is in scope (so that sizeof(buf) will work). Evaluates to true if the pathname fitted into * the provided buffer, false (0) otherwise (after logging an error). */ diff --git a/rhizome_database.c b/rhizome_database.c index 707bc440..76e5339a 100644 --- a/rhizome_database.c +++ b/rhizome_database.c @@ -63,39 +63,12 @@ int form_rhizome_datastore_path(char * buf, size_t bufsiz, const char *fmt, ...) return 1; } -int form_rhizome_import_path(char * buf, size_t bufsiz, const char *fmt, ...) -{ - va_list ap; - strbuf b = strbuf_local(buf, bufsiz); - strbuf_sprintf(b, "%s/import", rhizome_datastore_path()); - if (fmt) { - va_start(ap, fmt); - strbuf_putc(b, '/'); - strbuf_vsprintf(b, fmt, ap); - va_end(ap); - } - if (strbuf_overrun(b)) { - WHY("Path buffer overrun"); - return 0; - } - return 1; -} - int create_rhizome_datastore_dir() { if (config.debug.rhizome) DEBUGF("mkdirs(%s, 0700)", rhizome_datastore_path()); return emkdirs(rhizome_datastore_path(), 0700); } -int create_rhizome_import_dir() -{ - char dirname[1024]; - if (!form_rhizome_import_path(dirname, sizeof dirname, NULL)) - return -1; - if (config.debug.rhizome) DEBUGF("mkdirs(%s, 0700)", dirname); - return emkdirs(dirname, 0700); -} - sqlite3 *rhizome_db=NULL; /* XXX Requires a messy join that might be slow. */ diff --git a/rhizome_fetch.c b/rhizome_fetch.c index 982e14f0..0fe76dbe 100644 --- a/rhizome_fetch.c +++ b/rhizome_fetch.c @@ -543,8 +543,6 @@ static int schedule_fetch(struct rhizome_fetch_slot *slot) slot->write_state.blob_fd=-1; slot->write_state.blob_rowid=-1; - if (create_rhizome_import_dir() == -1) - RETURN(WHY("Unable to create import directory")); if (slot->manifest) { if (rhizome_open_write(&slot->write_state, slot->manifest->fileHexHash, slot->manifest->fileLength, RHIZOME_PRIORITY_DEFAULT)) RETURN(-1);