mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
In Windows spinup use CreteFile instead than FindFirst
It's just not possible to open the root dir with
FindFirstFile("C:\") or FindFirstFile("C:").
This commit is contained in:
parent
f65ee373e5
commit
894cd5ee70
1 changed files with 3 additions and 8 deletions
|
|
@ -1874,17 +1874,12 @@ static void* thread_spinup(void* arg)
|
|||
int f;
|
||||
uint64_t start;
|
||||
struct stat st;
|
||||
char* slash;
|
||||
|
||||
start = tick_ms();
|
||||
|
||||
/* removes latest slash to make FindFirstFile() working */
|
||||
slash = strrchr(devinfo->mount, '/');
|
||||
if (slash)
|
||||
*slash = 0;
|
||||
|
||||
/* uses lstat, as it maps to FindFirstFile */
|
||||
if (lstat(devinfo->mount, &st) != 0) {
|
||||
/* uses lstat_sync() that maps to CreateFile */
|
||||
/* we cannot use FindFirstFile because it doesn't allow to open the root dir */
|
||||
if (lstat_sync(devinfo->mount, &st, 0) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
pthread_mutex_lock(&io_lock);
|
||||
ferr("Failed to stat devinfo '%s'. %s.\n", devinfo->mount, strerror(errno));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue