Index: src/ports/SkOSFile_stdio.cpp |
diff --git a/src/ports/SkOSFile_stdio.cpp b/src/ports/SkOSFile_stdio.cpp |
index 5b497d417a93683d3fadc8a48f49d871edffd862..261d0613bb88131a80ab3806754437ece92b0037 100644 |
--- a/src/ports/SkOSFile_stdio.cpp |
+++ b/src/ports/SkOSFile_stdio.cpp |
@@ -32,7 +32,12 @@ SkFILE* sk_fopen(const char path[], SkFILE_Flags flags) { |
//TODO: on Windows fopen is just ASCII or the current code page, |
//convert to utf16 and use _wfopen |
- return (SkFILE*)::fopen(path, perm); |
+ SkFILE* file = (SkFILE*)::fopen(path, perm); |
+ if (nullptr == file && (flags & kWrite_SkFILE_Flag)) { |
+ SkDEBUGF(("sk_fopen: fopen(\"%s\", \"%s\") returned NULL (errno:%d): %s\n", |
+ path, perm, errno, strerror(errno))); |
+ } |
+ return file; |
} |
char* sk_fgets(char* str, int size, SkFILE* f) { |