From 0c767b9ae6f56968cd35efcaa79c74375ca692d6 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 9 Jul 2010 17:34:40 -0700 Subject: [PATCH] glslcompiler: Fix GCC warn_unused_result warning. --- src/mesa/drivers/glslcompiler/glslcompiler.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c index 4211e69ff9b..7259bf4c560 100644 --- a/src/mesa/drivers/glslcompiler/glslcompiler.c +++ b/src/mesa/drivers/glslcompiler/glslcompiler.c @@ -401,8 +401,12 @@ main(int argc, char *argv[]) if (v_shader || f_shader || g_shader) { if (Options.OutputFile) { + FILE *f; fclose(stdout); - /*stdout =*/ freopen(Options.OutputFile, "w", stdout); + /*stdout =*/ f = freopen(Options.OutputFile, "w", stdout); + if (!f) { + fprintf(stderr, "freopen error\n"); + } } if (stdout && v_shader) { PrintShaderInstructions(v_shader, stdout); -- 2.30.2