mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 10:10:09 +01:00
mesa/main/debug: Check if we successfully reopened the ppm file.
Since we created the file, we should be able to reopen it for appending, but some weird filesystem error could cause that to be false. So simply check whether we could reopen it or not. CID: 1177144 Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
81e15a5dea
commit
d42fc65bb3
1 changed files with 5 additions and 0 deletions
|
|
@ -235,6 +235,11 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height,
|
|||
fprintf(f,"255\n");
|
||||
fclose(f);
|
||||
f = fopen( filename, "ab" ); /* reopen in binary append mode */
|
||||
if (!f) {
|
||||
fprintf(stderr, "Error while reopening %s in write_ppm()\n",
|
||||
filename);
|
||||
return;
|
||||
}
|
||||
for (y=0; y < height; y++) {
|
||||
for (x = 0; x < width; x++) {
|
||||
int yy = invert ? (height - 1 - y) : y;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue