- if (backup_path != NULL) {
- if (stat (backup_path, &statbuf) != -1) {
- fprintf (stderr, "Backup path already exists: %s\n", backup_path);
- ret = NOTMUCH_STATUS_FILE_ERROR;
- goto DONE;
- }
- if (errno != ENOENT) {
- fprintf (stderr, "Unknown error while stat()ing backup path: %s\n",
- strerror (errno));
+ if (backup_path == NULL) {
+ if (! (backup_path = talloc_asprintf (local, "%s.old", xapian_path))) {
+ ret = NOTMUCH_STATUS_OUT_OF_MEMORY;