more meaningful diagnostics when mingw-get is invoked without arguments,
and corrects some omissions from the source tarball.
+- The follow-up release, designated as mingw-get-0.1-mingw32-alpha-5.2,
+ is a further bug-fix release. It provides a work-around for a defect
+ in the console I/O handling of MSYS mintty and MSYS rxvt, which causes
+ the stderr stream to appear to be inappropriately buffered within either
+ of these terminal emulators. As such, it is a recommended upgrade for
+ users of either of these emulators; it offers no tangible benefit to
+ other users.
+
===============================================
virtual uint16_t control( const uint16_t, const uint16_t );
virtual int notify( const dmh_severity, const char*, va_list );
virtual int printf( const char*, va_list );
+
+ private:
+ inline int emit_and_flush( int );
};
class dmhTypeGUI : public dmhTypeGeneric
};
dmh_exception::dmh_exception() throw()
- : message("Unspecified error")
+: message( "Unspecified error" )
{}
dmh_exception::dmh_exception::dmh_exception(const char * msg) throw()
- : message("Unspecified error")
+: message( "Unspecified error" )
{
- if (msg && *msg)
+ if( msg && *msg )
message = msg;
}
dmh_exception::~dmh_exception() throw()
{}
-const char * dmh_exception::what() const throw()
+const char* dmh_exception::what() const throw()
{
return message;
}
* of a DMH_FATAL exception.
*/
if( code == DMH_FATAL )
- throw dmh_exception("Fatal error occured");
+ throw dmh_exception( "Fatal error occured" );
/* If the exception wasn't DMH_FATAL, then fall through to
* return the specified status code.
return 0;
}
+inline int dmhTypeTTY::emit_and_flush( int status )
+{
+ /* Users of MSYS terminal emulators, in place of the standard
+ * MS-Windows console, may experience an I/O buffering issue on
+ * stderr (?!!) which may result in apparently erratic delivery
+ * of progress reporting diagnostics; this may lead to a false
+ * impression that mingw-get has stalled. This inline wrapper
+ * ensures that any buffer which is improperly associated with
+ * stderr is flushed after each message is posted; this may
+ * mitigate the improper buffering issue.
+ */
+ fflush( stderr );
+ return status;
+}
+
int dmhTypeTTY::notify( const dmh_severity code, const char *fmt, va_list argv )
{
/* Message dispatcher for console class applications.
/* Dispatch the message to standard error, terminate application
* if DMH_FATAL, else continue, returning the message length.
*/
- int retcode = fprintf( stderr, "%s: *** %s *** ", progname, severity[code] );
- return abort_if_fatal( code, retcode + vfprintf( stderr, fmt, argv ) );
+ return abort_if_fatal( code,
+ emit_and_flush(
+ fprintf( stderr, "%s: *** %s *** ", progname, severity[code] )
+ + vfprintf( stderr, fmt, argv )
+ )
+ );
}
int dmhTypeTTY::printf( const char *fmt, va_list argv )
/* Display arbitrary text messages via the diagnostic message handler;
* for the TTY subsystem, this is equivalent to printf() on stderr.
*/
- return vfprintf( stderr, fmt, argv );
+ return emit_and_flush( vfprintf( stderr, fmt, argv ) );
}
EXTERN_C uint16_t dmh_control( const uint16_t request, const uint16_t mask )