[PATCH] Avoiding unnecessary variable attribution

Ricardo Maraschini ricardo.maraschini at opservices.com.br
Mon Jul 9 23:35:43 CEST 2012


We actually don't need update_status variable.
OK? Comments?



--- base/commands.c	(revision 2021)
+++ base/commands.c	(working copy)
@@ -97,7 +97,6 @@
 /* checks for the existence of the external command file and processes all commands found in it */
 int check_for_external_commands(void) {
 	char *buffer = NULL;
-	int update_status = FALSE;
 
 	log_debug_info(DEBUGL_FUNCTIONS, 0, "check_for_external_commands()\n");
 
@@ -110,11 +109,7 @@
 
 	/* update the status log with new program information */
 	/* go easy on the frequency of this if we're checking often - only update program status every 10 seconds.... */
-	if(last_command_check < (last_command_status_update + 10))
-		update_status = FALSE;
-	else
-		update_status = TRUE;
-	if(update_status == TRUE) {
+	if(last_command_check >= (last_command_status_update + 10)) {
 		last_command_status_update = last_command_check;
 		update_program_status(FALSE);
 		}


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/




More information about the Developers mailing list