[icinga-checkins] icinga.org: icinga-core/test/cgis: classic-ui/idoutils: fixed compiler warnings
git at icinga.org
git at icinga.org
Tue Apr 3 09:26:30 CEST 2012
Module: icinga-core
Branch: test/cgis
Commit: 4d16663c168cb6cf5769a70e1ed7f7378054faab
URL: https://git.icinga.org/?p=icinga-core.git;a=commit;h=4d16663c168cb6cf5769a70e1ed7f7378054faab
Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date: Sat Feb 25 14:09:53 2012 +0100
classic-ui/idoutils: fixed compiler warnings
---
cgi/cgiutils.c | 6 +++---
cgi/readlogs.c | 6 +++---
module/idoutils/src/logging.c | 3 ++-
module/idoutils/src/utils.c | 3 ++-
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/cgi/cgiutils.c b/cgi/cgiutils.c
index 50ba63b..89f9f1a 100644
--- a/cgi/cgiutils.c
+++ b/cgi/cgiutils.c
@@ -96,9 +96,9 @@ extern char *macro_user[MAX_USER_MACROS];
/** readlogs.c **/
int log_rotation_method = LOG_ROTATION_NONE;
-time_t this_scheduled_log_rotation;
-time_t last_scheduled_log_rotation;
-time_t next_scheduled_log_rotation;
+extern time_t this_scheduled_log_rotation;
+extern time_t last_scheduled_log_rotation;
+extern time_t next_scheduled_log_rotation;
char log_file[MAX_INPUT_BUFFER];
char log_archive_path[MAX_INPUT_BUFFER];
diff --git a/cgi/readlogs.c b/cgi/readlogs.c
index c279146..711eded 100644
--- a/cgi/readlogs.c
+++ b/cgi/readlogs.c
@@ -48,9 +48,9 @@ extern char log_archive_path[MAX_FILENAME_LENGTH]; /**< the full path to the arc
/** @name vars for log archive determination
@{ **/
-extern time_t this_scheduled_log_rotation = 0L; /**< timestamp of current log rotation*/
-extern time_t last_scheduled_log_rotation = 0L; /**< timestamp of last log rotation */
-extern time_t next_scheduled_log_rotation = 0L; /**< timestamp of next log rotation */
+time_t this_scheduled_log_rotation = 0L; /**< timestamp of current log rotation*/
+time_t last_scheduled_log_rotation = 0L; /**< timestamp of last log rotation */
+time_t next_scheduled_log_rotation = 0L; /**< timestamp of next log rotation */
/** @} */
diff --git a/module/idoutils/src/logging.c b/module/idoutils/src/logging.c
index 4d8e747..d7fb051 100644
--- a/module/idoutils/src/logging.c
+++ b/module/idoutils/src/logging.c
@@ -75,6 +75,7 @@ int ido2db_log_debug_info(int level, int verbosity, const char *fmt, ...) {
struct timeval current_time;
unsigned long tid;
unsigned long pid;
+ int dummy = 0;
if (!(ido2db_debug_level == IDO2DB_DEBUGL_ALL || (level & ido2db_debug_level)))
return IDO_OK;
@@ -101,7 +102,7 @@ int ido2db_log_debug_info(int level, int verbosity, const char *fmt, ...) {
/* write the data */
va_start(ap, fmt);
/* use gnu asprintf to take care about null pointer data*/
- vasprintf(&buf, fmt, ap);
+ dummy = vasprintf(&buf, fmt, ap);
va_end(ap);
if (buf) {
fprintf(ido2db_debug_file_fp, "%s", buf);
diff --git a/module/idoutils/src/utils.c b/module/idoutils/src/utils.c
index 87f9bf6..0e8c013 100644
--- a/module/idoutils/src/utils.c
+++ b/module/idoutils/src/utils.c
@@ -103,6 +103,7 @@ int my_rename(char *source, char *dest) {
int source_fd = -1;
int dest_fd = -1;
int bytes_read = 0;
+ int dummy = 0;
/* make sure we have something */
@@ -125,7 +126,7 @@ int my_rename(char *source, char *dest) {
if ((source_fd = open(source, O_RDONLY, 0644)) > 0) {
while ((bytes_read = read(source_fd, buffer, sizeof(buffer))) > 0)
- write(dest_fd, buffer, bytes_read);
+ dummy = write(dest_fd, buffer, bytes_read);
close(source_fd);
close(dest_fd);
More information about the icinga-checkins
mailing list