Skip to contentSkip to conversation

package/nut: ensure time_t is defined

PATCH In review Fabrice Fontaine 2 participants 3 messages Feb 21, 2023 – Mar 17, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/nut: ensure time_t is defined

Ensure time_t is defined to fix the following collectd build failure on musl:

src/nut.c:40:2: error: #error "Unable to determine the UPS connection type."
40 | #error "Unable to determine the UPS connection type."

      |  ^~~~~
src/nut.c:46:3: error: unknown type name 'collectd_upsconn_t'
   46 |   collectd_upsconn_t *conn;
      |   ^~~~~~~~~~~~~~~~~~

libupsclient is an optional dependency of nut plugin since version 5.10.0 of collectd and
https://github.com/collectd/collectd/commit/bc2d94024d0250211c1e498db1b43bb4525324da

Fixes:
- http://autobuild.buildroot.org/results/22b758097e8fb72c68e41329cbc7abc748d81ca6

---
 ...upsclient-h-ensure-time_t-is-defined.patch | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 package/nut/0001-clients-upsclient-h-ensure-time_t-is-defined.patch
package/nut/0001-clients-upsclient-h-ensure-time_t-is-defined.patch new file +35 -0
new file mode 100644
index 0000000000..c9fb04b8cd
@@ -0,0 +1,35 @@
+From cafd77993ec5e16634b774b65bf6da9b34a21fc5 Mon Sep 17 00:00:00 2001
+From: Jim Klimov <[email protected]>
+Date: Wed, 31 Aug 2022 11:24:19 +0200
+Subject: [PATCH] clients/upsclient.h: ensure time_t is defined
+
+[Retrieved from:
+https://github.com/networkupstools/nut/commit/cafd77993ec5e16634b774b65bf6da9b34a21fc5]
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ clients/upsclient.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/clients/upsclient.h b/clients/upsclient.h
+index 08574b8f8b..e346d8f519 100644
+--- a/clients/upsclient.h
++++ b/clients/upsclient.h
+@@ -41,6 +41,18 @@
+ 	#include <limits.h>
+ #endif
+ 
++/* Not including NUT timehead.h because this is part of end-user API */
++#ifdef TIME_WITH_SYS_TIME
++# include <sys/time.h>
++# include <time.h>
++#else
++# ifdef HAVE_SYS_TIME_H
++#  include <sys/time.h>
++# else
++#  include <time.h>
++# endif
++#endif
++
+ #ifdef __cplusplus
+ /* *INDENT-OFF* */
+ extern "C" {
Signature · 6 lines
2.39.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

Ensure time_t is defined to fix the following collectd build failure on musl:

src/nut.c:40:2: error: #error "Unable to determine the UPS connection type."
40 | #error "Unable to determine the UPS connection type."

      |  ^~~~~
src/nut.c:46:3: error: unknown type name 'collectd_upsconn_t'
   46 |   collectd_upsconn_t *conn;
      |   ^~~~~~~~~~~~~~~~~~
Quoted 8 lines

libupsclient is an optional dependency of nut plugin since version 5.10.0 of collectd and
https://github.com/collectd/collectd/commit/bc2d94024d0250211c1e498db1b43bb4525324da

Fixes:
- http://autobuild.buildroot.org/results/22b758097e8fb72c68e41329cbc7abc748d81ca6

Committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Fabrice Fontaine
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

Ensure time_t is defined to fix the following collectd build failure on musl:

src/nut.c:40:2: error: #error "Unable to determine the UPS connection type."
40 | #error "Unable to determine the UPS connection type."

      |  ^~~~~
src/nut.c:46:3: error: unknown type name 'collectd_upsconn_t'
   46 |   collectd_upsconn_t *conn;
      |   ^~~~~~~~~~~~~~~~~~
Quoted 8 lines

libupsclient is an optional dependency of nut plugin since version 5.10.0 of collectd and
https://github.com/collectd/collectd/commit/bc2d94024d0250211c1e498db1b43bb4525324da

Fixes:
- http://autobuild.buildroot.org/results/22b758097e8fb72c68e41329cbc7abc748d81ca6

Committed to 2022.11.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot