From: David VaĊĦek Date: Tue, 2 Feb 2021 09:09:13 +0000 (+0100) Subject: zone backup: remove an excessive directory creation X-Git-Tag: v3.1.0~243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb4e9022bb998301a955bed3988992248e4a0391;p=thirdparty%2Fknot-dns.git zone backup: remove an excessive directory creation The directory has already been created before as a part of the lockfile preparation. --- diff --git a/src/knot/zone/backup.c b/src/knot/zone/backup.c index 1903185577..f1679006ee 100644 --- a/src/knot/zone/backup.c +++ b/src/knot/zone/backup.c @@ -84,15 +84,6 @@ int zone_backup_init(bool restore_mode, const char *backup_dir, pthread_mutex_init(&ctx->readers_mutex, NULL); - if (!restore_mode) { - int ret = mkdir(backup_dir, 0750); - if (ret == -1 && errno != EEXIST) { - pthread_mutex_destroy(&ctx->readers_mutex); - free(ctx); - return knot_map_errno(); - } - } - char db_dir[backup_dir_len + 16]; (void)snprintf(db_dir, sizeof(db_dir), "%s/keys", backup_dir); knot_lmdb_init(&ctx->bck_kasp_db, db_dir, kasp_db_size, 0, "keys_db");