From 69135ec73064de6760302ad77a22eef9d97ad2c9 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 19 Sep 2012 18:30:23 +0200 Subject: [PATCH] Added interim 1.12 release. --- HISTORY | 7 ++++++- Makefile.am | 2 +- check.c | 10 ++++++++++ configure.ac | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/HISTORY b/HISTORY index da55c8ee..6c28dca4 100644 --- a/HISTORY +++ b/HISTORY @@ -1,7 +1,7 @@ SnapRAID HISTORY ================ -1.12 2012/7 +1.13 2012/? =========== * The file modification time is now saved using nanosecond precision. This allows to restore the exact modification time in fix. @@ -12,6 +12,11 @@ SnapRAID HISTORY * Autosave isn't triggered if we are near the end of the process. * Fixed hard-links automatic exclusion after the first one. +1.12 2012/9 +============= + * Fixed file renaming in Windows during a 'fix' command. + This is only a Windows issue, no reason to upgrade for other platforms. + 1.11 2012/7 =========== * Fixed again directories inclusion. Exclusion rules for directories were diff --git a/Makefile.am b/Makefile.am index 26b494cc..1dea1069 100644 --- a/Makefile.am +++ b/Makefile.am @@ -56,7 +56,7 @@ mktest_SOURCES = \ EXTRA_DIST = \ autogen.sh \ noautomake.sh \ - README AUTHORS HISTORY INSTALL COPYING TODO TEST \ + README AUTHORS HISTORY INSTALL COPYING TODO TEST INSTALL.windows \ snapraid.d snapraid.1 snapraid.txt \ test-raid5.conf test-raid6.conf test-raid6-hole.conf \ snapraid.conf.example \ diff --git a/check.c b/check.c index 1f5a1f18..5c718512 100644 --- a/check.c +++ b/check.c @@ -845,6 +845,16 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna pathprint(path_from, sizeof(path_from), "%s%s", handle[j].disk->dir, handle[j].file->sub); pathprint(path_to, sizeof(path_to), "%s%s.unrecoverable", handle[j].disk->dir, handle[j].file->sub); + /* ensure to operate on a closed file */ + ret = handle_close(&handle[j]); + if (ret != 0) { + fprintf(stderr, "Error closing '%s'. %s.\n", path_from, strerror(errno)); + fprintf(stderr, "WARNING! Without a working data disk, it isn't possible to fix errors on it.\n"); + printf("Stopping at block %u\n", i); + ++unrecoverable_error; + goto bail; + } + ret = rename(path_from, path_to); if (ret != 0) { fprintf(stderr, "Error renaming '%s' to '%s'. %s.\n", path_from, path_to, strerror(errno)); diff --git a/configure.ac b/configure.ac index 6ce34dc1..b61155c4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.65]) -AC_INIT([snapraid], [1.12], [], [], [http://snapraid.sourceforge.net]) +AC_INIT([snapraid], [1.13], [], [], [http://snapraid.sourceforge.net]) AM_INIT_AUTOMAKE([foreign no-dependencies -Wall]) AC_CONFIG_SRCDIR([snapraid.c]) AC_CONFIG_HEADER([config.h])