[icinga-checkins] icinga.org: icinga-core/mfriedrich/workers: core: remove dead prototype leftovers from passive check direct handling

git at icinga.org git at icinga.org
Sun Aug 5 23:32:13 CEST 2012


Module: icinga-core
Branch: mfriedrich/workers
Commit: 993ea6a04d382961edec62716307cfd1b9e367e8
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=993ea6a04d382961edec62716307cfd1b9e367e8

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Sun Aug  5 18:07:34 2012 +0200

core: remove dead prototype leftovers from passive check direct handling

refs #2687

---

 base/utils.c       |   62 ----------------------------------------------------
 include/icinga.h   |    1 -
 t-tap/stub_utils.c |    1 -
 t-tap/test-stubs.c |    1 -
 4 files changed, 0 insertions(+), 65 deletions(-)

diff --git a/base/utils.c b/base/utils.c
index c238fb5..da7766d 100644
--- a/base/utils.c
+++ b/base/utils.c
@@ -2426,68 +2426,6 @@ int drop_privileges(char *user, char *group) {
 /************************* IPC FUNCTIONS **************************/
 /******************************************************************/
 
-/* move check result to queue directory */
-int move_check_result_to_queue(char *checkresult_file) {
-	char *output_file = NULL;
-	char *temp_buffer = NULL;
-	int output_file_fd = -1;
-	mode_t new_umask = 077;
-	mode_t old_umask;
-	int result = 0;
-
-	/* save the file creation mask */
-	old_umask = umask(new_umask);
-
-	/* create a safe temp file */
-	dummy = asprintf(&output_file, "%s/cXXXXXX", check_result_path);
-	output_file_fd = mkstemp(output_file);
-
-	/* file created okay */
-	if (output_file_fd >= 0) {
-
-		log_debug_info(DEBUGL_CHECKS, 2, "Moving temp check result file '%s' to queue file '%s'...\n", checkresult_file, output_file);
-
-#ifdef __CYGWIN__
-		/* Cygwin cannot rename open files - gives Permission Denied */
-		/* close the file */
-		close(output_file_fd);
-#endif
-
-		/* move the original file */
-		result = my_rename(checkresult_file, output_file);
-
-#ifndef __CYGWIN__
-		/* close the file */
-		close(output_file_fd);
-#endif
-
-		/* create an ok-to-go indicator file */
-		dummy = asprintf(&temp_buffer, "%s.ok", output_file);
-		if ((output_file_fd = open(temp_buffer, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR)) >= 0)
-			close(output_file_fd);
-		my_free(temp_buffer);
-
-		/* delete the original file if it couldn't be moved */
-		if (result != 0)
-			unlink(checkresult_file);
-	} else
-		result = -1;
-
-	/* reset the file creation mask */
-	umask(old_umask);
-
-	/* log a warning on errors */
-	if (result != 0)
-		logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: Unable to move file '%s' to check results queue.\n", checkresult_file);
-
-	/* free memory */
-	my_free(output_file);
-
-	return OK;
-}
-
-
-
 /* processes files in the check result queue directory */
 int process_check_result_queue(char *dirname) {
 	char file[MAX_FILENAME_LENGTH];
diff --git a/include/icinga.h b/include/icinga.h
index 3cbd0b0..0a3f791 100644
--- a/include/icinga.h
+++ b/include/icinga.h
@@ -415,7 +415,6 @@ void adjust_timestamp_for_time_change(time_t,time_t,
 
 
 /**** IPC Functions ****/
-int move_check_result_to_queue(char *);
 int process_check_result_queue(char *);
 int process_check_result_file(char *);
 int process_check_result(check_result *);
diff --git a/t-tap/stub_utils.c b/t-tap/stub_utils.c
index 82911b2..a7c9822 100644
--- a/t-tap/stub_utils.c
+++ b/t-tap/stub_utils.c
@@ -1,6 +1,5 @@
 /* Stub for base/utils.c */
 void get_next_valid_time(time_t pref_time, time_t *valid_time, timeperiod *tperiod) {}
 int update_check_stats(int check_type, time_t check_time) {}
-int move_check_result_to_queue(char *checkresult_file) {}
 int check_time_against_period(time_t test_time, timeperiod *tperiod) {}
 
diff --git a/t-tap/test-stubs.c b/t-tap/test-stubs.c
index 754f86a..8a18663 100644
--- a/t-tap/test-stubs.c
+++ b/t-tap/test-stubs.c
@@ -159,7 +159,6 @@ int dbuf_strcat(dbuf *db, char *buf) {}
 int dbuf_free(dbuf *db) {}
 unsigned long   next_event_id = 0L;
 unsigned long   next_problem_id = 0L;
-int move_check_result_to_queue(char *checkresult_file) {}
 int             free_child_process_memory = -1;
 void free_memory(icinga_macros *mac) {}
 int accept_passive_service_checks = TRUE;





More information about the icinga-checkins mailing list