Align Windows rotational device detection fallback with Unix by assuming rotational when unknown

This commit is contained in:
Andrea Mazzoleni 2026-08-12 00:10:26 +02:00
parent 3e4f79180e
commit b4a694bb10

View file

@ -1230,7 +1230,7 @@ static int devpower(uint64_t device, const char* name, const char* wfile)
DWORD error = GetLastError();
windows_errno(error);
log_tag("device:%s:%s:error:%lu\n", file, name, error);
return 0; /* assume not rotational */
return 1; /* assume rotational if unknown */
}
/* get the interface */
@ -1248,11 +1248,11 @@ static int devpower(uint64_t device, const char* name, const char* wfile)
DWORD error = GetLastError();
windows_errno(error);
log_tag("device:%s:%s:error:%lu\n", file, name, error);
return 0; /* assume not rotational */
return 1; /* assume rotational if unknown */
}
if (rotational == SMART_UNASSIGNED)
return 0; /* assume not rotational */
return 1; /* assume rotational if unknown */
return rotational != 0;
}