summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c7c26fb)
raw | patch | inline | side by side (parent: c7c26fb)
author | octo <octo> | |
Sat, 10 Jun 2006 11:08:15 +0000 (11:08 +0000) | ||
committer | octo <octo> | |
Sat, 10 Jun 2006 11:08:15 +0000 (11:08 +0000) |
The apcups daemon can handle it and it's nicer to the system to just leave the
socket open, so that's what we're doing. The socket is still closed if
`APCMAIN' is defined.
socket open, so that's what we're doing. The socket is still closed if
`APCMAIN' is defined.
src/apcups.c | patch | blob | history |
diff --git a/src/apcups.c b/src/apcups.c
index e2ad70cb0c4e6c243fc79f7d9a4021c9b283084a..f5a0deac941f21b745e1bdd7fd7409072889fb3e 100644 (file)
--- a/src/apcups.c
+++ b/src/apcups.c
return (buflen);
}
+#if APCMAIN
/* Close the network connection */
static void net_close (int *fd)
{
close (*fd);
*fd = -1;
}
+#endif /* APCMAIN */
/*
* Open a TCP connection to the UPS network server
syslog (LOG_WARNING, "apcups plugin: Error reading from socket");
return (-1);
}
+#if APCMAIN
else
{
/* close the opened socket */
net_close (&sockfd);
}
+#endif /* APCMAIN */
return (0);
}