Deemon: Fix handling of broken Database Connection
fixes #14 git-svn-id: file:///home/jan/tmp/wetterstation/trunk@259 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
parent
b65de8de92
commit
23ff8045db
|
|
@ -78,6 +78,9 @@ int main(int argc, char *argv[]){
|
|||
|
||||
DEBUGOUT1("Programm gestartet\n");
|
||||
|
||||
if(signal(SIGPIPE, SIG_IGN) == SIG_ERR)
|
||||
exit_error(ERROR_SEIINST);
|
||||
DEBUGOUT1("SIGPIPE ignoriert\n");
|
||||
if(signal(SIGABRT, exit_sig_handler) == SIG_ERR)
|
||||
exit_error(ERROR_SEIINST);
|
||||
DEBUGOUT1("Signalhandler zum beenden per SIGABRT installiert\n");
|
||||
|
|
|
|||
|
|
@ -113,6 +113,9 @@ static void check_create_query_buffer(){
|
|||
/* Guckt ob Verbindung da und versucht aufzubauen.
|
||||
* gibt 1 zurueck, wenn erfolgreich, sonst 0 */
|
||||
static int pg_connect(){
|
||||
if (PQstatus(connection) == CONNECTION_OK){
|
||||
PQexec(connection,"SELECT 1"); /* Status neusetzen erzwingen */
|
||||
}
|
||||
if(PQstatus(connection) != CONNECTION_OK){
|
||||
if (connection == NULL){
|
||||
if(conn_string == NULL){
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
weatherstation (1.0.16-1) stable; urgency=low
|
||||
|
||||
* Daemon: Fix handling of broken Database Connections
|
||||
|
||||
-- Jan Losinski <losinski@wh2.tu-dresden.de> Wed, 29 Jul 2008 16:53:00 +0100
|
||||
|
||||
weatherstation (1.0.16) stable; urgency=low
|
||||
|
||||
* Frontend: Adding caching
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<Set type="full">
|
||||
<Module id="1">
|
||||
<FullSet>
|
||||
<Sensor id="1">
|
||||
{content:addModule:xmltemp_1}
|
||||
{content:addModule:xmlhum_1}
|
||||
{content:addModule:xmlpress_1}
|
||||
</Sensor>
|
||||
<Module id="4">
|
||||
<Sensor id="4">
|
||||
{content:addModule:xmltemp_4}
|
||||
{content:addModule:xmlhum_4}
|
||||
</Sensor>
|
||||
<Module id="2">
|
||||
<Sensor id="2">
|
||||
{content:addModule:xmlwind_2}
|
||||
</Sensor>
|
||||
<Module id="3">
|
||||
<Sensor id="3">
|
||||
{content:addModule:xmlrain_3}
|
||||
</Sensor>
|
||||
</Set>
|
||||
</FullSet>
|
||||
|
|
|
|||
Loading…
Reference in New Issue