summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c88c2de)
raw | patch | inline | side by side (parent: c88c2de)
author | Florian Forster <octo@collectd.org> | |
Fri, 12 May 2017 06:05:47 +0000 (08:05 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 12 May 2017 09:22:46 +0000 (11:22 +0200) |
Fixes: #2272
configure.ac | patch | blob | history | |
src/nut.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index d4207ab6b239e45a830c88d190394b3cb372f2be..3962fc999a47797f1eb21b282d0e7a630a715b54 100644 (file)
--- a/configure.ac
+++ b/configure.ac
)
AC_CHECK_LIB([upsclient], [upscli_init],
- [AC_DEFINE([WITH_UPSCLIENT_27], [1], [At least version 2-7])],
- []
+ [AC_DEFINE([HAVE_UPSCLI_INIT], [1], [Define when upscli_init() (since version 2-7) is available.])]
)
LDFLAGS="$SAVE_LDFLAGS"
diff --git a/src/nut.c b/src/nut.c
index 5acbdde63946eecae6e751456a207057d77170b4..7dadf50eba7ad0f0a4ce2bb6543e0dcab76ba665 100644 (file)
--- a/src/nut.c
+++ b/src/nut.c
} /* void nut_submit */
static int nut_connect(nut_ups_t *ups) {
-#ifdef WITH_UPSCLIENT_27
+#if HAVE_UPSCLI_INIT
int status;
int ssl_status;
int ssl_flags;
} /* if (ssl_status == 1 && verify_peer == 1) */
return (0);
-#else /* #ifdef WITH_UPSCLIENT_27 */
+#else /* #if HAVE_UPSCLI_INIT */
int status;
int ssl_status;
int ssl_flags;
ups->upsname, upscli_strerror(ups->conn));
upscli_disconnect(ups->conn);
sfree(ups->conn);
-#ifdef WITH_UPSCLIENT_27
+#if HAVE_UPSCLI_INIT
upscli_cleanup();
#endif
return (-1);
free_nut_ups_t(this);
this = next;
}
-#ifdef WITH_UPSCLIENT_27
+#if HAVE_UPSCLI_INIT
upscli_cleanup();
#endif