Ethereal-dev: Re: [Ethereal-dev] Bad File Descriptor trying to open ANY file

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 7 Nov 2003 14:13:46 -0800

On Nov 7, 2003, at 1:48 PM, Michael Lum wrote:

I have built an ethereal.exe.

It fails to open any file, with the popup given (attachment).

The prebuild binary does not have a problem.

Does anybody have any ideas ?

The code path that produces the error probably goes through "cf_open()".

That goes through "wtap_open_offline()", which calls "open()" - which should be mapped to "_open()" on Windows, courtesy of GLib - to get a C-library file descriptor. It then calls "filed_open()" to get a "FILE *"; if you're building with Zlib, that's "gzdopen()", otherwise it's "fdopen()" (which should be mapped to "_fdopen()" on Windows).

If "wtap_open_offline()" succeeds, it calls "wtap_fd()", which should return the file descriptor, and does an "fstat()" on that (which might get mapped to "_fstat()" on Windows).

It probably failed in:

	1) "_open()";

	2) "_fdopen()", if you're not building with ZLib;

	3) "_fstat()".

Those *should* presumably all work in VS.NET, as well as the VC++ 6.0 that many of us use, but perhaps Microsoft "improved" things so that they don't actually work.

If you're building with Zlib, perhaps there's some problem with Zlib - the Zlib binaries were probably built with VC++ 6.0 or earlier, but that should presumably work with VS.NET, but, again, perhaps Microsoft "improved" things.