Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1221)

Unified Diff: src/ports/SkOSFile_stdio.cpp

Issue 1326743004: Give reason while file open failed. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Comments. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698