[HarfBuzz] harfbuzz-ng: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Jan 30 06:48:42 PST 2012


 util/options.cc |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit f51e167436a51b890ffe3f7f7920498fa287acd9
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jan 30 09:48:33 2012 -0500

    Minor error handling

diff --git a/util/options.cc b/util/options.cc
index c394fd5..e5e76c9 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -534,7 +534,8 @@ font_options_t::get_font (void) const
       destroy = (hb_destroy_func_t) g_free;
       mm = HB_MEMORY_MODE_WRITABLE;
     } else {
-      GMappedFile *mf = g_mapped_file_new (font_file, FALSE, NULL);
+      GError *error = NULL;
+      GMappedFile *mf = g_mapped_file_new (font_file, FALSE, &error);
       if (mf) {
 	font_data = g_mapped_file_get_contents (mf);
 	len = g_mapped_file_get_length (mf);
@@ -544,6 +545,9 @@ font_options_t::get_font (void) const
 	  mm = HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE;
 	} else
 	  g_mapped_file_unref (mf);
+      } else {
+	fail (FALSE, "%s", error->message);
+	//g_error_free (error);
       }
       if (!len) {
 	/* GMappedFile is buggy, it doesn't fail if file isn't regular.



More information about the HarfBuzz mailing list