You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2010/10/02 14:50:44 UTC
svn commit: r1003791 - in /commons/proper/daemon/trunk/src/native/windows:
apps/prunsrv/prunsrv.c src/log.c
Author: mturk
Date: Sat Oct 2 12:50:44 2010
New Revision: 1003791
URL: http://svn.apache.org/viewvc?rev=1003791&view=rev
Log:
More logging and error display tweaks. Make sure we don't display No error when loggging error
Modified:
commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
commons/proper/daemon/trunk/src/native/windows/src/log.c
Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c?rev=1003791&r1=1003790&r2=1003791&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunsrv/prunsrv.c Sat Oct 2 12:50:44 2010
@@ -41,7 +41,7 @@
#define STDERR_FILENO 2
#define ONE_MINUTE (60 * 1000)
-#ifdef WIN64
+#ifdef _WIN64
#define KREG_WOW6432 KEY_WOW64_32KEY
#define PRG_BITS 64
#else
@@ -337,14 +337,11 @@ static void printUsage(LPAPXCMDLINE lpCm
static void printVersion(void)
{
-#ifdef _WIN64
- int b = 64;
-#else
- int b = 32;
-#endif
fwprintf(stderr, L"Commons Daemon Service Runner version %S/Win%d (%S)\n",
- PRG_VERSION, b, __DATE__);
- fwprintf(stderr, L"Copyright (c) 2000-2010 The Apache Software Foundation.\n");
+ PRG_VERSION, PRG_BITS, __DATE__);
+ fwprintf(stderr, L"Copyright (c) 2000-2010 The Apache Software Foundation.\n\n"
+ L"For bug reporting instructions, please see:\n"
+ L"<URL:https://issues.apache.org/jira/browse/DAEMON>.");
}
/* Display configuration parameters */
@@ -1519,7 +1516,7 @@ cleanup:
apxLogWrite(APXLOG_MARK_ERROR "Commons Daemon procrun failed "
"with exit value: %d (Failed to %s)",
rv, gSzProc[ipx]);
- if (ipx && !_service_mode) {
+ if (ipx > 2 && !_service_mode) {
/* Print something to the user console */
apxDisplayError(FALSE, NULL, 0, "Failed to %s", gSzProc[ipx]);
}
Modified: commons/proper/daemon/trunk/src/native/windows/src/log.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/src/log.c?rev=1003791&r1=1003790&r2=1003791&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/src/log.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/src/log.c Sat Oct 2 12:50:44 2010
@@ -23,8 +23,8 @@
static LPCSTR _log_level[] = {
"[debug] ",
- "[info] ",
- "[warn] ",
+ "[info] ",
+ "[warn] ",
"[error] ",
NULL
};
@@ -260,14 +260,22 @@ apxLogWrite(
}
szBp = &buffer[0];
if (!szFormat) {
- FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- err,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- szBp,
- 1000,
- NULL);
+ if (err == 0) {
+ lstrcpyA(szBp, "Unknown error code");
+ if (dwLevel == APXLOG_LEVEL_ERROR) {
+ szBp += 18;
+ wsprintfA(szBp, " occured in (%s:%d) ", f, dwLine);
+ }
+ }
+ else
+ FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ err,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ szBp,
+ 1000,
+ NULL);
}
else {
va_start(args, szFormat);