Fixes the Windows regression test.

This commit is contained in:
Andrea Mazzoleni 2014-07-11 23:33:19 +02:00
parent 71ff0620ce
commit ea4eafb60d
2 changed files with 5 additions and 4 deletions

View file

@ -125,7 +125,7 @@ unsigned char* file_read(const char* path, int size, int extra_alloc)
data = malloc(size + extra_alloc);
f = open(path, O_RDONLY);
f = open(path, O_RDONLY | O_BINARY);
if (f < 0) {
/* LCOV_EXCL_START */
fprintf(stderr, "Error opening file %s\n", path);
@ -154,7 +154,7 @@ void file_write(const char* path, const unsigned char* data, int size, struct st
{
int f;
f = creat(path, S_IRUSR | S_IWUSR);
f = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_NOFOLLOW, 0600);
if (f < 0) {
/* LCOV_EXCL_START */
fprintf(stderr, "Error creating file %s\n", path);

View file

@ -1031,13 +1031,14 @@ static int scan_dir(struct snapraid_scan* scan, int output, const char* dir, con
/* LCOV_EXCL_STOP */
}
#if HAVE_STRUCT_DIRENT_D_INO
if (state->opt.force_order == SORT_ALPHA) {
/* if requested sort alphabetically */
/* this is mainly done for testing to ensure to always */
/* process in the same way in different platforms */
tommy_list_sort(&list, dd_name_compare);
} else if (!disk->has_volatile_inodes) {
}
#if HAVE_STRUCT_DIRENT_D_INO
else if (!disk->has_volatile_inodes) {
/* if inodes are persistent */
/* sort the list of dir entries by inodes */
tommy_list_sort(&list, dd_ino_compare);