> The exception is actually returning the value of errno, which ought to
> contain the appropriate error code.  This may be a case where we need some
> Windows-specific call to get an error code.
>

Confirmed, this class is using the Win32 file API (CreateFile, etc) and
throwing an exception based on errno, rather than GetLastError().
XalanFileOutputStream.cpp #154:

#if defined(WIN32)
    if (m_handle == INVALID_HANDLE_VALUE)
#else
    if (m_handle == 0)
#endif
        {
                throw XalanFileOutputStreamOpenException(
                                        theFileName,
                                        errno);
        }

I've attached a patch against CVS to correct the problem.  In other places
in the same class, this appears to be correctly implemented.

Attachment: XalanFileOutputStream.patch
Description: Binary data

Reply via email to