Skip to content

Commit

Permalink
Give reason while file open failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
bungeman authored and Commit bot committed Sep 2, 2015
1 parent 5a42c33 commit 0881b95
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ports/SkOSFile_stdio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0881b95

Please sign in to comment.