projects
/
monky
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a1ddcc0
)
Bugfix: crash when apcupsd isnt running
author
Nikolas Garofil
<garo@dunaldi.garofil.be>
Mon, 16 Nov 2009 19:19:57 +0000
(20:19 +0100)
committer
Nikolas Garofil
<garo@dunaldi.garofil.be>
Mon, 16 Nov 2009 19:19:57 +0000
(20:19 +0100)
src/apcupsd.c
patch
|
blob
|
history
diff --git
a/src/apcupsd.c
b/src/apcupsd.c
index
d6b6e76
..
7bec156
100644
(file)
--- a/
src/apcupsd.c
+++ b/
src/apcupsd.c
@@
-181,7
+181,7
@@
void update_apcupsd(void) {
break;
}
#ifdef HAVE_GETHOSTBYNAME_R
- if (gethostbyname_r(info.apcupsd.host, &he_mem, hostbuff, sizeof(hostbuff), &he, &he_errno)) {
+ if (gethostbyname_r(info.apcupsd.host, &he_mem, hostbuff, sizeof(hostbuff), &he, &he_errno) || !he ) {
NORM_ERR("APCUPSD gethostbyname_r: %s", hstrerror(h_errno));
break;
}