load_file (const gchar *filename,
           GError **error)
{
  GError *local_error = NULL;

  g_autoptr(GMappedFile) mapped = g_mapped_file_new (filename, FALSE, &local_error);

  if (mapped)
    /* success! */
    return g_mapped_file_get_bytes (mapped);

  if (g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_NOENT) ||
      g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_ISDIR) ||
      g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_NAMETOOLONG) ||
      g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_LOOP) ||
      g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_INVAL))
    {
      g_clear_error (&local_error);
    }

  /* A real error to stop on */
  else
    {
      g_propagate_error (error, local_error);
    }

  return NULL;
}
load_file (const gchar *filename,
           GError **error)
{
  GError *local_error = NULL;

  g_autoptr(GMappedFile) mapped = g_mapped_file_new (filename, FALSE, &local_error);

  if (mapped)
     
    return g_mapped_file_get_bytes (mapped);

  if (g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_NOENT) ||
      g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_ISDIR) ||
      g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_NAMETOOLONG) ||
      g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_LOOP) ||
      g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_INVAL))
    {
      g_clear_error (&local_error);
    }

   
  else
    {
      g_propagate_error (error, local_error);
    }

  return NULL;
}