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

Replace zbx_snprintf() function/macro with function pointer #141

Merged
merged 1 commit into from Apr 23, 2019

Conversation

@i-ky
Copy link
Contributor

commented Apr 23, 2019

...which is initialized in runtime. The idea is that instead of using zbx_snprintf() defined by Zabbix, module will define a function pointer with the same name and signature. Function pointer will be set to point either to zbx_snprintf() or __zbx_zbx_snprintf() depending on what Zabbix binary can provide. This will allow module to work with older Zabbix versions where zbx_snprintf() is a preprocessor macro wrapping __zbx_zbx_snprintf() function as well as with newer versions where zbx_snprintf() is a real function. Theoretically, it should not matter what version of Zabbix source was used to compile module binary. Hopefully, this resolves #139.

…initialized in runtime
@cavaliercoder cavaliercoder merged commit f039714 into cavaliercoder:master Apr 23, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Trikke76

This comment has been minimized.

Copy link

commented Apr 24, 2019

I have compiled the module with zabbix sources 4.0.7 en postgres v11 and it seems to work
however there is an issue with logging.
the whole module is loggin in debug mode

6909:20190424:080402.762 In PG_VERSION()
6909:20190424:080402.762 In pg_get_result(pg.version)
6909:20190424:080402.762 In pg_scalar
6909:20190424:080402.762 In pg_connect()
6909:20190424:080402.762 Connecting to PostgreSQL with: *****
6909:20190424:080402.765 End of pg_connect()
6909:20190424:080402.765 Executing query with 0 parameters: SELECT version();
6909:20190424:080402.766 End of pg_scalar
6909:20190424:080402.766 End of pg_get_result(pg.version)
6909:20190424:080402.766 End of PG_VERSION()

@i-ky

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

Probably a bug in Zabbix log.h header.

@i-ky

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

Turns out, definition and behaviour of zabbix_log() has changed as well. This will require more hacking...

@i-ky i-ky deleted the i-ky:compatibility-hack branch Apr 29, 2019
@i-ky

This comment has been minimized.

Copy link
Contributor Author

commented May 6, 2019

Hacking continues in #142.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.