Extended Android file store error logs.
[ Merge of http://go/wvgerrit/120763 ] This change introduces additional logging information for files and file system operations on Android. File reading and writing will attempt to make sense of |errno| and log useful information. In the event that the file must be closed, the file stat will be printed. Failures in determining the file size will print potential reasons for the encountered error. This partly restructures the File interface implementation to use file descriptors instead of the C standard libraries FILE handle. This is done to ensure that |errno| is set to an expected value. This change also introduces the utility functions SafeWrite() and SafeRead() to handle common, retriable errors. Bug: 178232354 Test: Android MediaDrm GTS and Android file-based unittests Change-Id: I15a3c47a271098c9edb4bd9f619ed1a12dca6143
This commit is contained in:
@@ -13,7 +13,7 @@ const char kCurrentDirectory[] = ".";
|
||||
const char kParentDirectory[] = "..";
|
||||
const char kDirectoryDelimiter = '/';
|
||||
const char kWildcard[] = "*";
|
||||
bool IsCurrentOrParentDirectory(char* dir);
|
||||
bool IsCurrentOrParentDirectory(const char* dir);
|
||||
|
||||
class FileUtils {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user