Fixes a directory creation problem in Windows in the root directory.

This commit is contained in:
Andrea Mazzoleni 2013-07-31 22:10:11 +02:00
parent a3eecd1eae
commit a8efa5b325
2 changed files with 16 additions and 0 deletions

View file

@ -1,6 +1,15 @@
SnapRAID HISTORY
================
3.2 2013/7
==========
* Fix a directory creation problem in Windows when the "disk" option points to
the root directory of a drive. Now SnapRAID won't complain about the
inability to create such directory.
If you encouter this problem when trying to recover your data, just upgrade
to this version, and you'll be able to complete the recovering process.
No need to upgrade for platforms different than Windows.
3.1 2013/5
==========
* Direct use of Windows API for disk access to improve error reporting.

7
util.c
View file

@ -696,6 +696,13 @@ int mkancestor(const char* file)
return 0;
}
#ifdef _WIN32
if (strlen(dir) == 2 && dir[1] == ':') {
/* it's a drive specification, nothing more to do */
return 0;
}
#endif
/* try creating it */
if (mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0) {
/* just created */