Closed Bug 753856 Opened 9 years ago Closed 9 years ago

a CONERR$ file is created when firefox is launched from command line

Categories

(Toolkit :: Startup and Profile System, defect)

All
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file, 1 obsolete file)

Regression from bug 673383.
Its patch assumes that a special file called `CONERR$` exists on Win32 and refer to some equivalent of `GetStdHandle( STD_ERROR_HANDLE )` but for the libc, when we are using freopen.

According to the creation of this file, and to the following documentation, this magic file doesn't exists:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683231%28v=vs.85%29.aspx
Here is a simple way to fix this, just use CONOUT$ instead.
It sounds quite bad to mix stdout and stderr in the same pipe but I'm wondering if Windows command line supports any difference between both?

I tried to build a more complex patch where I used same code than with -console [1]. It looks like a better option as we have the feeling that we support stdout and stderr separately. It works fine on regular cmd.exe command line but fails when we launch firefox from cygwin. We don't get any std output.

[1] http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/nsNativeAppSupportWin.cpp#396
Assignee: nobody → poirot.alex
Oh and I fixed 80 column limit on comments and remove the `return;` statement as it prevents `-console` argument to work if we launch firefox from a command line.
I don't see why we would use -console from a command line, but may be some tooling or old program want to do such thing!
FYI, here is the patch I mentioned in comment 1, which fails on cygwin.
Attachment #622795 - Flags: review?(ted.mielczarek)
Attachment #622795 - Flags: review?(ted.mielczarek) → review+
Whiteboard: checkin-needed
Here is try results:
https://tbpl.mozilla.org/?tree=Try&rev=43f9478a5b20
Some failures, but seems to be intermittent ones?
Indeed, all known-intermittent.
Attachment #622795 - Flags: checkin+
Whiteboard: checkin-needed
Target Milestone: --- → mozilla15
Attachment #622798 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/0265d5b5ff86
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.