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

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: 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..b7268a3f5b35975d1aba3c7857b1ee83a37622e2 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) {
+ SkDEBUGF(("sk_fopen: fopen(%s, %s) returned NULL errno:%d :%s\n",
+ path, perm, errno, strerror(errno)));
djsollen 2015/09/02 18:44:06 fix spacing but otherwise lgtm
bungeman-skia 2015/09/02 19:35:54 Done.
+ }
+ 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