[ZBX-10578] some functions calls unnecessary init_result() before calling process() function Created: 2016 Mar 25  Updated: 2024 Apr 10  Resolved: 2017 Oct 10

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G), Server (S)
Affects Version/s: 2.2.10, 2.2.11
Fix Version/s: 4.0.0alpha1, 4.0 (plan)

Type: Patch request Priority: Trivial
Reporter: MATSUDA Daiki Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File zabbix-2.2.11-removed-unneccessary-init_result.patch    
Epic Link: DEV-591
Team: Team A
Team: Team A
Sprint: Sprint 17, Sprint 18
Story Points: 1

 Description   

some functions calls unnecessary init_result() before calling process() function because in process() function it is called.

In 2.2.11 followings are
src/libs/zbxsysinfo/sysinfo.c : test_parameter()
src/libs/zbxmedia/jabber.c : lookup_jabber()
src/zabbix_server/discoverer/discoverer.c : discover_service
src/zabbix_agent/zabbix_agent.c : main()
src/zabbix_agent/listener.c : process_listener()
src/zabbix_agent/active.c : refresh_active_checks()
src/zabbix_agent/active.c : process_active_checks()
src/zabbix_agent/zabbix_agentd.c : set_defaults()
src/zabbix_proxy/proxy.c : zbx_set_defaults()



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2016 Mar 29 ]

You are right! Thanks for pointing this out!

Comment by MATSUDA Daiki [ 2016 Mar 30 ]

I think that init_result() should be removed from process() and any functions which declare the variable 'AGENT_RESULT result' must call init_result().
So, reading src/zabbix_server/poller/polle.c, it is difficult to remain it in process().

Comment by Andrea Biscuola (Inactive) [ 2017 Oct 09 ]

Resolved in svn://svn.zabbix.com/branches/dev/ZBX-10578

In some places, the init_result() function is being called by both
the caller and the callee for initializing an AGENT_RESULT
structure. Cleanup the redundant calls and make the initialization
happen only on the callers.
Additionally, some minor style fixes.

Original diff from MATSUDA Daiki. Minor adaptations from me
for being applied to trunk.

Comment by Andrea Biscuola (Inactive) [ 2017 Oct 10 ]

Released in:

  • pre-4.0.0alpha1 (trunk) r73389
Generated at Sat Apr 20 14:50:01 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.