summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/et/ChangeLog5
-rw-r--r--src/util/et/com_err.c11
2 files changed, 15 insertions, 1 deletions
diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog
index 66daf0747..e536e6a58 100644
--- a/src/util/et/ChangeLog
+++ b/src/util/et/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb 11 13:31:49 1997 Richard Basch <basch@lehman.com>
+
+ * com_err.c: If the application is a console application, simply
+ display the message to stderr. (win32)
+
Mon Feb 10 21:30:41 1997 Theodore Y. Ts'o <tytso@mit.edu>
* com_err.c, com_err.h (com_err_va): Fix broken Windows 16
diff --git a/src/util/et/com_err.c b/src/util/et/com_err.c
index 2b1d10078..387458f95 100644
--- a/src/util/et/com_err.c
+++ b/src/util/et/com_err.c
@@ -22,6 +22,9 @@
#include "com_err.h"
#include "error_table.h"
+#if defined(_MSDOS) || defined(_WIN32)
+#include <io.h>
+#endif
#ifdef _MACINTOSH
#include "icons.h"
static void MacMessageBox(errbuf);
@@ -96,7 +99,13 @@ void KRB5_CALLCONV default_com_err_proc(ectx, priv, whoami, code, fmt, ap)
MacMessageBox(errbuf);
#else
/* For Windows */
- MessageBox ((HWND)NULL, errbuf, "Kerberos", MB_ICONEXCLAMATION);
+ if (_isatty(_fileno(stderr))) {
+ fputs(errbuf, stderr);
+ fputc('\r', stderr);
+ fputc('\n', stderr);
+ fflush(stderr);
+ } else
+ MessageBox ((HWND)NULL, errbuf, "Kerberos", MB_ICONEXCLAMATION);
#endif
}
#endif