LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

LDIRECTORD: Use $dbh->errstr instead of $dbh->err when logging

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: LDIRECTORD: Use $dbh->errstr instead of $dbh->err when logging
Cc: Roberto Nibali <rnibali@xxxxxxxxx>
Cc: J.Libak@xxxxxxxxxx
Cc: Roberto Nibali <ratz@xxxxxxxxxxxx>
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Tue, 24 Apr 2007 19:02:01 +0900
$dbh->errstr is a string describing the error whereas $dbh->err
is just a number. The fomer seems somewhat more useful for logging
purposes.

Cc: Roberto Nibali <ratz@xxxxxxxxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: heartbeat/ldirectord/ldirectord.in
===================================================================
--- heartbeat.orig/ldirectord/ldirectord.in     2007-04-24 17:47:45.000000000 
+0900
+++ heartbeat/ldirectord/ldirectord.in  2007-04-24 17:48:22.000000000 +0900
@@ -2506,7 +2506,8 @@ sub check_sql
                            "host=$$r{server};port=$port", $$v{login},
                            $$v{passwd});
        unless ($dbh) {
-               &ld_debug(4, "Failed to bind to $$r{server} with $dbh->err");
+               &ld_debug(4, "Failed to bind to $$r{server} with " .
+                         $dbh->errstr);
                service_set($v, $r, "down");
                return 1;
        }

-- 

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


<Prev in Thread] Current Thread [Next in Thread>