Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error saving time in write_mongo #955

Open
eremenko opened this issue Mar 3, 2015 · 2 comments
Open

error saving time in write_mongo #955

eremenko opened this issue Mar 3, 2015 · 2 comments

Comments

@eremenko
Copy link

eremenko commented Mar 3, 2015

need next patch

--- collectd-5.1.0-orig/src/utils_time.h     2012-04-02 12:04:58.000000000 +0400
+++ collectd-5.1.0-fixed/src/utils_time.h   2012-11-12 10:08:46.938078527 +0400
@@ -44,7 +44,7 @@
 #define DOUBLE_TO_CDTIME_T(d) ((cdtime_t) ((d) * 1073741824.0))

 #define MS_TO_CDTIME_T(ms) ((cdtime_t)    (((double) (ms)) * 1073741.824))
-#define CDTIME_T_TO_MS(t)  ((long)        (((double) (t))  / 1073741.824))
+#define CDTIME_T_TO_MS(t)  ((uint64_t)    (((double) (t))  / 1073741.824))
 #define US_TO_CDTIME_T(us) ((cdtime_t)    (((double) (us)) * 1073.741824))
 #define CDTIME_T_TO_US(t)  ((suseconds_t) (((double) (t))  / 1073.741824))
 #define NS_TO_CDTIME_T(ns) ((cdtime_t)    (((double) (ns)) * 1.073741824))
@rubenk rubenk added the Waiting label Aug 6, 2016
@rubenk
Copy link
Contributor

rubenk commented Aug 6, 2016

Hi,

What is the exact issue you're having? That patch will break a lot of things, so we really need to know more about your problem.

Please know that the write_mongodb plugin is essentially unmaintained and only works with older version of the MongoDB api.

@octo
Copy link
Member

octo commented Aug 6, 2016

Presumably a problem on 32bit systems, where long is only 32bit wide. There are only two other plugins using this macro: dns and java. Both of them always cast the returned value to the type they need – I don't think this patch will break anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants