Hi all,

I'm having assertion failed at
server/mpm/winnt/nt_eventlog.c: mpm_nt_eventlog_stderr_open()
...
    /* Flush stderr and unset its buffer, then commit and replace stderr.
     * This is typically a noop for Win2K/XP since services with NULL std
     * handles [but valid FILE *'s, oddly enough], but is required
     * for NT 4.0 and to use this code outside of services.
     */
    fflush(stderr);
    setvbuf(stderr, NULL, _IONBF, 0);
    _commit(2 /* stderr */);
========================================

1. FlushFileBuffers which is called from _commit() returns ERROR_INVALID_HANDLE.

2. 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/flushfilebuffers.asp
states that:
"The function fails if hFile is a handle to the console output. That
is because the console output is not buffered. The function returns
FALSE, and GetLastError returns ERROR_INVALID_HANDLE.

    Windows Me/98/95:  The function does nothing if hFile is a handle
to the console output. That is because console output is not buffered.
The function returns TRUE, but it does nothing."

3. fflush does _commit() if appropriate flags are set:
        /* lowio commit to ensure data is written to disk */
        if (str->_flag & _IOCOMMIT) {
                return (_commit(_fileno(str)) ? EOF : 0);


I think we can remove safely _commit() call.

Note: I have Win XP Pro(sp2) & Visual Studio 2005.

Vadim.

Reply via email to