Closed Bug 417372 Opened 16 years ago Closed 16 years ago

permit RWS to be disabled

Categories

(Core Graveyard :: Widget: OS/2, defect)

x86
OS/2
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dragtext, Assigned: mozilla)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch to nsRwsService.cpp (obsolete) — Splinter Review
Currently, there's no reliable way to disable the RWS08 library's WPS-integration features.  The attached patch to nsRwsService.cpp tests for the environment variable "MOZ_NORWS" in the class's constructor.  If it exists, the constructor returns NS_ERROR_NOT_AVAILABLE - the same as when the library can't be found.
Yes, that is a good idea, will make the doc part in README.txt easier. How about calling the variable MOZ_DISABLE_RWS instead? The other environment variable we have also test the value to be 1 or true. As there is no good way (that I know of) to unset a variable in standard CMD we should still use RWS if MOZ_DISABLE_RWS=0. Like we use for the hires timer in NSPR:

   char *envp;
   if ((envp = getenv("NSPR_OS2_NO_HIRES_TIMER")) != NULL) {
       if (atoi(envp) == 1)
           return;
   }
(In reply to comment #1)

> How about calling the variable MOZ_DISABLE_RWS instead?

You already have MOZ_NO_REMOTE & NSPR_OS2_NO_HIRES_TIMER, so MOZ_NO_RWS would be more consistent (and somewhat easier to remember).

>  As there is no good way (that I know of) to unset a variable in standard CMD

"SET MOZ_NO_RWS="

> The other environment variable we have also test the value to be 1 or true.
> [...] we should still use RWS if MOZ_DISABLE_RWS=0. Like we use for the hires
> timer in NSPR:

I was more nearly emulating MOZ_NO_REMOTE:

    if (getenv("MOZ_NO_REMOTE")) {
        mUseDDE = PR_FALSE;
        *aResult = PR_TRUE;
        return NS_OK;
    }

Use whichever model you wish - and feel free to change my DosScanEnv() to getenv().
(In reply to comment #2)
> You already have MOZ_NO_REMOTE & NSPR_OS2_NO_HIRES_TIMER, so MOZ_NO_RWS would
> be more consistent (and somewhat easier to remember).

OK, convinced.

> >  As there is no good way (that I know of) to unset a variable in standard CMD
> 
> "SET MOZ_NO_RWS="

Last time I tried that it wasn't really removed from the environment (still got something back from getenv()). Will retest, perhaps I messed something up back then.
(In reply to comment #3)
> (In reply to comment #2)
> > >  As there is no good way (that I know of) to unset a variable in standard CMD
> > 
> > "SET MOZ_NO_RWS="
> 
> Last time I tried that it wasn't really removed from the environment (still got
> something back from getenv()). Will retest, perhaps I messed something up back
> then.

OK, turns out that that this is a bug in the YAOS shell that I still always come back to despite all the other great CMD replacements that are available.
Attached patch working patchSplinter Review
OK, I couldn't get DosScanEnv to compile (problems with const char** vs char** that I didn't just want to cast away) so I used PR_GetEnv instead. Rich, does that look OK to you, too?
Attachment #303160 - Attachment is obsolete: true
(In reply to comment #5)
> Created an attachment (id=308229) [details]
> working patch
> 
> I used PR_GetEnv instead. Rich, does that look OK to you, too?

Sure.  I suppose PR_GetEnv() was always the "proper" way to do this.
Great, fix checked into trunk.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: