]> git.saurik.com Git - redis.git/blobdiff - src/redis.c
Added -ldl when linking against jemalloc, needed on Linux
[redis.git] / src / redis.c
index e7351b6ef5381001b8b78dc221fad40a85a12fc0..1a1f84f916b9f1024b4b19a491d07dae6888485d 100644 (file)
@@ -901,6 +901,7 @@ void initServerConfig() {
     server.replstate = REDIS_REPL_NONE;
     server.repl_syncio_timeout = REDIS_REPL_SYNCIO_TIMEOUT;
     server.repl_serve_stale_data = 1;
+    server.repl_down_since = -1;
 
     /* Double constants initialization */
     R_Zero = 0.0;
@@ -1356,7 +1357,7 @@ sds genRedisInfoString(char *section) {
             server.stat_peak_memory,
             peak_hmem,
             zmalloc_get_fragmentation_ratio(),
-            REDIS_MALLOC
+            ZMALLOC_LIB
             );
     }
 
@@ -1522,6 +1523,12 @@ sds genRedisInfoString(char *section) {
                     (int)(time(NULL)-server.repl_transfer_lastio)
                 );
             }
+
+            if (server.replstate != REDIS_REPL_CONNECTED) {
+                info = sdscatprintf(info,
+                    "master_link_down_since_seconds:%ld\r\n",
+                    (long)time(NULL)-server.repl_down_since);
+            }
         }
         info = sdscatprintf(info,
             "connected_slaves:%d\r\n",