]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/general-scheme.cc
Clean up g++ 4.6.1 compiler warnings (-Wunused-but-set-variable).
[lilypond.git] / lily / general-scheme.cc
index e74bf0bf1627b2a8e96ed232d923194a9cd396c6..a630fd90f534768f8592e24d01b49bfec48e86b6 100644 (file)
@@ -379,13 +379,16 @@ LY_DEFINE (ly_stderr_redirect, "ly:stderr-redirect",
   LY_ASSERT_TYPE (scm_is_string, file_name, 1);
 
   string m = "w";
+  string f = ly_scm2string (file_name);
   FILE *stderrfile;
   if (mode != SCM_UNDEFINED && scm_string_p (mode))
     m = ly_scm2string (mode);
   /* dup2 and (fileno (current-error-port)) do not work with mingw'c
      gcc -mwindows.  */
   fflush (stderr);
-  stderrfile = freopen (ly_scm2string (file_name).c_str (), m.c_str (), stderr);
+  stderrfile = freopen (f.c_str (), m.c_str (), stderr);
+  if (!stderrfile)
+    error (_f ("failed redirecting stderr to `%s'", f.c_str ()));
   return SCM_UNSPECIFIED;
 }