[iOS] Fix return code when failing to load ICU data (#66055)
authorSteve Pfister <steveisok@users.noreply.github.com>
Thu, 3 Mar 2022 14:05:27 +0000 (09:05 -0500)
committerGitHub <noreply@github.com>
Thu, 3 Mar 2022 14:05:27 +0000 (09:05 -0500)
`GlobalizationNative_LoadICUData` was returning -1 when loading failed instead of 0. The result would be a misleading exception as opposed to failing the application fast.

Fixes https://github.com/dotnet/runtime/issues/66030

src/native/libs/System.Globalization.Native/pal_icushim_static.c

index 7813f9a..98b20ca 100644 (file)
@@ -459,13 +459,13 @@ GlobalizationNative_LoadICUData(const char* path)
     if (icu_data == NULL)
     {
         log_shim_error("Failed to load ICU data.");
-        return -1;
+        return 0;
     }
 
     if (load_icu_data(icu_data) == 0)
     {
         log_shim_error("ICU BAD EXIT.");
-        return -1;
+        return 0;
     }
 
     return GlobalizationNative_LoadICU();