Closed Bug 578493 Opened 14 years ago Closed 14 years ago

Set env vars before loading libraries

Categories

(Core Graveyard :: Widget: Android, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: blassey, Assigned: blassey)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
some of our initialization code check env vars and we set them too late for the values to be picked up as it stands

This patch also makes some changes to embedding/android/Makefile.in to allow make clean && make to work properly. Specifically it switches to using nsinstall and rm -rf, if there is a reason we weren't doing that before please explain and I'll drop that from the patch.
Attachment #457156 - Flags: review?(mwu)
Blocks: 578496
Comment on attachment 457156 [details] [diff] [review]
patch

>+__attribute__ ((visibility("default")))
>+void JNICALL
>+Java_org_mozilla_gecko_GeckoAppShell_putenv(JNIEnv *jenv, jclass, jstring map)
>+{
>+    const char* str;
>+    str = jenv->GetStringUTFChars(map, NULL);
>+    if (str == NULL)
>+        return;
>+    putenv(strdup(str));
>+    jenv->ReleaseStringUTFChars(map, str);
>+}
>+
This is really my only issue with this patch, since java UTF8 isn't actually UTF8. Can't think of anything better that wouldn't make us depend on libxul though. Maybe put some sort of XXX about this issue here.
Attachment #457156 - Flags: review?(mwu) → review+
Perhaps we need an NS_ConvertJavaToUTF16
pushed http://hg.mozilla.org/mozilla-central/rev/8e58befb03a5
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee: nobody → blassey.bugs
tracking-fennec: ? → ---
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.