mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix detecting errors from OS buffered reads in Linux.
This commit is contained in:
@@ -633,7 +633,14 @@ namespace Aaru.Devices.Linux
|
||||
end = DateTime.Now;
|
||||
duration = (end - start).TotalMilliseconds;
|
||||
|
||||
return sense < 0 ? Marshal.GetLastWin32Error() : 0;
|
||||
int errno = Marshal.GetLastWin32Error();
|
||||
|
||||
if(sense == length)
|
||||
errno = 0;
|
||||
else if(errno == 0)
|
||||
errno = -22;
|
||||
|
||||
return errno;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user