fixed typo; fixed fail flags access
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 15 Jun 2016 16:43:27 +0000 (19:43 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 15 Jun 2016 16:43:27 +0000 (19:43 +0300)
src/agent/core/getparam.cpp
src/agent/core/localdb.cpp
src/agent/core/nxagentd.cpp
src/agent/core/nxagentd.h

index c444f98..bfe2ca3 100644 (file)
@@ -191,7 +191,7 @@ static LONG H_ComponentStatus(const TCHAR *pszParam, const TCHAR *pArg, TCHAR *p
       case 'D':
          if ((g_failFlags & FAIL_OPEN_DATABASE) != 0)
             result++;
-         if ((g_failFlags & FIAL_UPGRADE_DATABASE) != 0)
+         if ((g_failFlags & FAIL_UPGRADE_DATABASE) != 0)
             result++;
          break;
       case 'L':
index 03e12fc..3282e43 100644 (file)
@@ -240,13 +240,13 @@ bool OpenLocalDatabase()
    if (s_db == NULL)
    {
       nxlog_debug(1, _T("Local database open error: %s"), errorText);
-          g_failFlags = FAIL_OPEN_DATABASE;
+          g_failFlags |= FAIL_OPEN_DATABASE;
       return false;
    }
 
    if (!CheckDatabaseStructure() || !UpgradeDatabase())
    {
-          g_failFlags = FIAL_UPGRADE_DATABASE;
+          g_failFlags |= FAIL_UPGRADE_DATABASE;
       DBDisconnect(s_db);
       s_db = NULL;
       return false;
index 2edd3b8..182d2db 100644 (file)
@@ -698,7 +698,7 @@ BOOL Initialize()
        {
           //TODO: set flag that log have been opened with errors
           s_debugLevel = 1;
-          g_failFlags = FAIL_OPEN_LOG;
+          g_failFlags |= FAIL_OPEN_LOG;
       nxlog_open(NXAGENTD_SYSLOG_NAME, NXLOG_USE_SYSLOG |
                       ((g_dwFlags & AF_BACKGROUND_LOG_WRITER) ? NXLOG_BACKGROUND_WRITER : 0) |
                   ((g_dwFlags & AF_DAEMON) ? 0 : NXLOG_PRINT_TO_STDOUT),
index 914f1cf..5312d20 100644 (file)
 #define AF_ENABLE_SNMP_TRAP_PROXY   0x00200000
 #define AF_BACKGROUND_LOG_WRITER    0x00400000
 
-//Flags for errors while loading
+// Flags for component failures
 #define FAIL_OPEN_LOG               0x00000001
 #define FAIL_OPEN_DATABASE          0x00000002
-#define FIAL_UPGRADE_DATABASE       0x00000004
+#define FAIL_UPGRADE_DATABASE       0x00000004
 
 #ifdef _WIN32