diff options
author | bouyer <bouyer@pkgsrc.org> | 2016-02-07 21:52:06 +0000 |
---|---|---|
committer | bouyer <bouyer@pkgsrc.org> | 2016-02-07 21:52:06 +0000 |
commit | 3493db9d5f5ac7655a94c4a1ed18637210244363 (patch) | |
tree | d73e368b0d5dd4323f6c78f9084b60e948caafda /net/nagios-base | |
parent | 82bc0bb99ff6b71411910c3ef31380022370e4d7 (diff) | |
download | pkgsrc-3493db9d5f5ac7655a94c4a1ed18637210244363.tar.gz |
more 64bit time_t fixes. Now compiles without -Wformat warnings.
Ride previous PKGREVISION bump
Diffstat (limited to 'net/nagios-base')
-rw-r--r-- | net/nagios-base/distinfo | 19 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-base_checks.c | 22 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-base_events.c | 24 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-base_logging.c | 13 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-base_nerd.c | 15 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-cgi_avail.c | 75 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-cgi_cmd.c | 119 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-cgi_histogram.c | 30 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-cgi_trends.c | 32 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-common_downtime.c | 15 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-lib_test-squeue.c | 15 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-lib_worker.c | 15 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-xdata_xrddefault.c | 124 | ||||
-rw-r--r-- | net/nagios-base/patches/patch-xdata_xsddefault.c | 150 |
14 files changed, 649 insertions, 19 deletions
diff --git a/net/nagios-base/distinfo b/net/nagios-base/distinfo index 93c3737764d..82fb1652578 100644 --- a/net/nagios-base/distinfo +++ b/net/nagios-base/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.28 2016/02/07 12:41:11 bouyer Exp $ +$NetBSD: distinfo,v 1.29 2016/02/07 21:52:06 bouyer Exp $ SHA1 (nagios-4.0.8.tar.gz) = d49586db6905a8e58a082251d8f89ef5c2cab872 RMD160 (nagios-4.0.8.tar.gz) = b53631755e0a23aba918a99f58b7bea237fdd799 @@ -10,14 +10,21 @@ SHA512 (nagios-netbsd40-icons.tar.gz) = 27cd564ef6dbe076b43dc2207f8f4f49bfb575f2 Size (nagios-netbsd40-icons.tar.gz) = 5659 bytes SHA1 (patch-Makefile.in) = 953eea6b276beba75ab5c64c14d10cdcf1ca2188 SHA1 (patch-base_Makefile.in) = 2b0162bb4d395b1d529f5fc1fdf9eab3ddaeb161 -SHA1 (patch-base_logging.c) = a37151fbf36b4f0858a4eaad3c6704a32fb493da +SHA1 (patch-base_checks.c) = 9c5fb7a8f085eed2fb31ad623eeed22596c6c168 +SHA1 (patch-base_events.c) = 6b659c6980c69ab1947d7a829c87482f53ed817e +SHA1 (patch-base_logging.c) = 09d532acf5978ff581b7f4d211bdd286a18c1886 +SHA1 (patch-base_nerd.c) = 4105d3a56999077688e42c9c771e76461fe00785 SHA1 (patch-cgi_Makefile.in) = 25c22914986c0b781f5dd665a7a53778e1031a63 -SHA1 (patch-cgi_cmd.c) = 90dfbfc78b08c5d72f168003d6c9fb56d67a8743 +SHA1 (patch-cgi_avail.c) = d0faf28256e5ee31ad36bdb08d59d8310c7cef8d +SHA1 (patch-cgi_cmd.c) = 6953e62e99a4df32f8dba452d2a85af66bf3ce8b SHA1 (patch-cgi_extinfo.c) = 8cad0787fbe0a782edb93ca299462a5718a34a4b SHA1 (patch-cgi_getcgi.c) = 3af474de4f4281f18a306f7d618ff532d0a9ca9e +SHA1 (patch-cgi_histogram.c) = 4b9f583ec4579d5c5399ad1b7102511c0282b8bc SHA1 (patch-cgi_statusjson.c) = 13967c18ee3eaaaf75edb8b3ee028bece73272ae +SHA1 (patch-cgi_trends.c) = 4e5057536465192b67fcd5a141f34be816ff4452 SHA1 (patch-common_Makefile.in) = 7fa093a6109dfa03f9b97e4312d3a09e3235f00f SHA1 (patch-common_comments.c) = 7739c9c74333c45e86242383073dfa78785445ec +SHA1 (patch-common_downtime.c) = 000f1e33ab1ca1c433c3fd0de3d5bf750df6f57f SHA1 (patch-configure) = f57db3a43c1abc1aa0d6fe007308089c620624a4 SHA1 (patch-daemon-init.in) = 1e50bb84fde9780d5b13edb4e232c0e3a90ac3f4 SHA1 (patch-html_Makefile.in) = 33ca19b5cf37839be6fbd851a5dcf29d4d701c8b @@ -26,8 +33,10 @@ SHA1 (patch-include_locations.h.in) = 0ee376f6737b24f0d4ea8b37781aca70147c5e70 SHA1 (patch-include_statusjson.h) = c5a84b9ef3114f2e2480d719bbb4a24c8965e052 SHA1 (patch-lib_nsock.c) = bd8801e4aff13ebac26e512b44764c2da1e2e5a5 SHA1 (patch-lib_runcmd.c) = fb34fe5cdc39aca973c1a6e125b125867e6ed262 +SHA1 (patch-lib_test-squeue.c) = 1bc197da815a069f0f37525f1acbf5fb4110d399 +SHA1 (patch-lib_worker.c) = c70fd4cec230cefc94cd82a20a20c7ecef3cae2a SHA1 (patch-sample-config_nagios.cfg.in) = 4ad00840ad66d2e01b19c6db76c810fc3fb80795 SHA1 (patch-t-tap_test__xsddefault.c) = db7166fae411a461d8b4a4a31f55af693aeb03b0 SHA1 (patch-xdata_xcddefault.c) = ba14af868cd773d07e029a2773a44614eedc3e46 -SHA1 (patch-xdata_xrddefault.c) = 0883a8ea4bac21523b0aa6ef77272ba5ae0c8b42 -SHA1 (patch-xdata_xsddefault.c) = 6255158bfe90a390678f2b834935e809b21d560c +SHA1 (patch-xdata_xrddefault.c) = 8cc130bd14b0dbd6ba57cda9819f4b5d99639178 +SHA1 (patch-xdata_xsddefault.c) = 61c22eb8601adb53ab06b685198c7000b4743c76 diff --git a/net/nagios-base/patches/patch-base_checks.c b/net/nagios-base/patches/patch-base_checks.c new file mode 100644 index 00000000000..cbe3fedbc13 --- /dev/null +++ b/net/nagios-base/patches/patch-base_checks.c @@ -0,0 +1,22 @@ +$NetBSD: patch-base_checks.c,v 1.1 2016/02/07 21:52:06 bouyer Exp $ + +64bit time_t workaround + +--- base/checks.c.orig 2016-02-07 21:52:43.000000000 +0100 ++++ base/checks.c 2016-02-07 21:54:09.000000000 +0100 +@@ -1320,12 +1320,12 @@ + if(expected_time < current_time) { + + /* log a warning */ +- logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: The check of service '%s' on host '%s' looks like it was orphaned (results never came back; last_check=%lu; next_check=%lu). I'm scheduling an immediate check of the service...\n", temp_service->description, temp_service->host_name, temp_service->last_check, temp_service->next_check); ++ logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: The check of service '%s' on host '%s' looks like it was orphaned (results never came back; last_check=%lu; next_check=%lu). I'm scheduling an immediate check of the service...\n", temp_service->description, temp_service->host_name, (unsigned long)temp_service->last_check, (unsigned long)temp_service->next_check); + + log_debug_info(DEBUGL_CHECKS, 1, "Service '%s' on host '%s' was orphaned, so we're scheduling an immediate check...\n", temp_service->description, temp_service->host_name); + log_debug_info(DEBUGL_CHECKS, 1, " next_check=%lu (%s); last_check=%lu (%s);\n", +- temp_service->next_check, ctime(&temp_service->next_check), +- temp_service->last_check, ctime(&temp_service->last_check)); ++ (unsigned long)temp_service->next_check, ctime(&temp_service->next_check), ++ (unsigned long)temp_service->last_check, ctime(&temp_service->last_check)); + + /* decrement the number of running service checks */ + if(currently_running_service_checks > 0) diff --git a/net/nagios-base/patches/patch-base_events.c b/net/nagios-base/patches/patch-base_events.c new file mode 100644 index 00000000000..09be0b8f648 --- /dev/null +++ b/net/nagios-base/patches/patch-base_events.c @@ -0,0 +1,24 @@ +$NetBSD: patch-base_events.c,v 1.1 2016/02/07 21:52:06 bouyer Exp $ + +64bit time_t workaround + +--- base/events.c.orig 2016-02-07 21:54:30.000000000 +0100 ++++ base/events.c 2016-02-07 21:55:49.000000000 +0100 +@@ -354,7 +354,7 @@ + if(check_delay > check_window(temp_service)) { + log_debug_info(DEBUGL_EVENTS, 0, + " Fixing check time %lu secs too far away\n", +- check_delay - check_window(temp_service)); ++ (unsigned long)(check_delay - check_window(temp_service))); + fixed_services++; + check_delay = ranged_urand(0, check_window(temp_service)); + log_debug_info(DEBUGL_EVENTS, 0, " New check offset: %d\n", +@@ -507,7 +507,7 @@ + check_delay = mult_factor * scheduling_info.host_inter_check_delay; + if(check_delay > check_window(temp_host)) { + log_debug_info(DEBUGL_EVENTS, 1, "Fixing check time (off by %lu)\n", +- check_delay - check_window(temp_host)); ++ (unsigned long)(check_delay - check_window(temp_host))); + fixed_hosts++; + check_delay = ranged_urand(0, check_window(temp_host)); + } diff --git a/net/nagios-base/patches/patch-base_logging.c b/net/nagios-base/patches/patch-base_logging.c index dc71c2189dc..faec2d0ae4f 100644 --- a/net/nagios-base/patches/patch-base_logging.c +++ b/net/nagios-base/patches/patch-base_logging.c @@ -2,8 +2,8 @@ $NetBSD$ 64bit time_t workaround ---- base/logging.c.orig 2016-02-07 13:23:57.000000000 +0100 -+++ base/logging.c 2016-02-07 13:24:50.000000000 +0100 +--- base/logging.c.orig 2014-08-12 17:00:01.000000000 +0200 ++++ base/logging.c 2016-02-07 21:57:26.000000000 +0100 @@ -184,7 +184,7 @@ strip(buffer); @@ -13,3 +13,12 @@ $NetBSD$ fflush(fp); #ifdef USE_EVENT_BROKER +@@ -495,7 +495,7 @@ + + /* write the timestamp */ + gettimeofday(¤t_time, NULL); +- fprintf(debug_file_fp, "[%lu.%06lu] [%03d.%d] [pid=%lu] ", current_time.tv_sec, current_time.tv_usec, level, verbosity, (unsigned long)getpid()); ++ fprintf(debug_file_fp, "[%lu.%06lu] [%03d.%d] [pid=%lu] ", (unsigned long)current_time.tv_sec, (unsigned long)current_time.tv_usec, level, verbosity, (unsigned long)getpid()); + + /* write the data */ + va_start(ap, fmt); diff --git a/net/nagios-base/patches/patch-base_nerd.c b/net/nagios-base/patches/patch-base_nerd.c new file mode 100644 index 00000000000..7be1f1c9e4a --- /dev/null +++ b/net/nagios-base/patches/patch-base_nerd.c @@ -0,0 +1,15 @@ +$NetBSD: patch-base_nerd.c,v 1.1 2016/02/07 21:52:06 bouyer Exp $ + +64bit time_t workaround + +--- base/nerd.c.orig 2016-02-07 21:13:59.000000000 +0100 ++++ base/nerd.c 2016-02-07 21:14:15.000000000 +0100 +@@ -337,7 +337,7 @@ + } else + return 0; + +- asprintf(&buf, "%lu|%s|M|%s/%s|%06X\n", cr->finish_time.tv_sec, ++ asprintf(&buf, "%lu|%s|M|%s/%s|%06X\n", (unsigned long)cr->finish_time.tv_sec, + check_result_source(cr), host_parent_path(h, '/'), name, color); + nerd_broadcast(chan_opath_checks_id, buf, strlen(buf)); + free(buf); diff --git a/net/nagios-base/patches/patch-cgi_avail.c b/net/nagios-base/patches/patch-cgi_avail.c new file mode 100644 index 00000000000..4b318429f2e --- /dev/null +++ b/net/nagios-base/patches/patch-cgi_avail.c @@ -0,0 +1,75 @@ +$NetBSD: patch-cgi_avail.c,v 1.3 2016/02/07 21:52:06 bouyer Exp $ + +64bit time_t workaround + +--- cgi/avail.c.orig 2016-02-07 22:09:22.000000000 +0100 ++++ cgi/avail.c 2016-02-07 22:13:16.000000000 +0100 +@@ -367,10 +367,10 @@ + host_report_url("all", "View Availability Report For All Hosts"); + printf("<BR>\n"); + #ifdef USE_TRENDS +- printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s&assumeinitialstates=%s&includesoftstates=%s&assumestatesduringnotrunning=%s&initialassumedhoststate=%d&backtrack=%d'>View Trends For This Host</a><BR>\n", TRENDS_CGI, url_encode(host_name), t1, t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_host_state, backtrack_archives); ++ printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s&assumeinitialstates=%s&includesoftstates=%s&assumestatesduringnotrunning=%s&initialassumedhoststate=%d&backtrack=%d'>View Trends For This Host</a><BR>\n", TRENDS_CGI, url_encode(host_name), (unsigned long)t1, (unsigned long)t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_host_state, backtrack_archives); + #endif + #ifdef USE_HISTOGRAM +- printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Alert Histogram For This Host</a><BR>\n", HISTOGRAM_CGI, url_encode(host_name), t1, t2, (assume_state_retention == TRUE) ? "yes" : "no"); ++ printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Alert Histogram For This Host</a><BR>\n", HISTOGRAM_CGI, url_encode(host_name), (unsigned long)t1, (unsigned long)t2, (assume_state_retention == TRUE) ? "yes" : "no"); + #endif + printf("<a href='%s?host=%s'>View Status Detail For This Host</a><BR>\n", STATUS_CGI, url_encode(host_name)); + printf("<a href='%s?host=%s'>View Alert History For This Host</a><BR>\n", HISTORY_CGI, url_encode(host_name)); +@@ -383,11 +383,11 @@ + printf("<BR>\n"); + #ifdef USE_TRENDS + printf("<a href='%s?host=%s", TRENDS_CGI, url_encode(host_name)); +- printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s&includesoftstates=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d'>View Trends For This Service</a><BR>\n", url_encode(svc_description), t1, t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); ++ printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s&includesoftstates=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d'>View Trends For This Service</a><BR>\n", url_encode(svc_description), (unsigned long)t1, (unsigned long)t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); + #endif + #ifdef USE_HISTOGRAM + printf("<a href='%s?host=%s", HISTOGRAM_CGI, url_encode(host_name)); +- printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Alert Histogram For This Service</a><BR>\n", url_encode(svc_description), t1, t2, (assume_state_retention == TRUE) ? "yes" : "no"); ++ printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Alert Histogram For This Service</a><BR>\n", url_encode(svc_description), (unsigned long)t1, (unsigned long)t2, (assume_state_retention == TRUE) ? "yes" : "no"); + #endif + printf("<A HREF='%s?host=%s&", HISTORY_CGI, url_encode(host_name)); + printf("service=%s'>View Alert History For This Service</A><BR>\n", url_encode(svc_description)); +@@ -3952,9 +3952,9 @@ + #ifdef USE_TRENDS + printf("<p align='center'>\n"); + printf("<a href='%s?host=%s", TRENDS_CGI, url_encode(host_name)); +- printf("&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedhoststate=%d&backtrack=%d'>", t1, t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_host_state, backtrack_archives); ++ printf("&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedhoststate=%d&backtrack=%d'>", (unsigned long)t1, (unsigned long)t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_host_state, backtrack_archives); + printf("<img src='%s?createimage&smallimage&host=%s", TRENDS_CGI, url_encode(host_name)); +- printf("&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedhoststate=%d&backtrack=%d' border=1 alt='Host State Trends' title='Host State Trends' width='500' height='20'>", t1, t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_host_state, backtrack_archives); ++ printf("&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedhoststate=%d&backtrack=%d' border=1 alt='Host State Trends' title='Host State Trends' width='500' height='20'>", (unsigned long)t1, (unsigned long)t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_host_state, backtrack_archives); + printf("</a><br>\n"); + printf("</p>\n"); + #endif +@@ -4436,9 +4436,9 @@ + #ifdef USE_TRENDS + printf("<p align='center'>\n"); + printf("<a href='%s?host=%s", TRENDS_CGI, url_encode(host_name)); +- printf("&service=%s&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d'>", url_encode(svc_description), t1, t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); ++ printf("&service=%s&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d'>", url_encode(svc_description), (unsigned long)t1, (unsigned long)t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); + printf("<img src='%s?createimage&smallimage&host=%s", TRENDS_CGI, url_encode(host_name)); +- printf("&service=%s&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d' border=1 alt='Service State Trends' title='Service State Trends' width='500' height='20'>", url_encode(svc_description), t1, t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); ++ printf("&service=%s&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d' border=1 alt='Service State Trends' title='Service State Trends' width='500' height='20'>", url_encode(svc_description), (unsigned long)t1, (unsigned long)t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); + printf("</a><br>\n"); + printf("</p>\n"); + #endif +@@ -4677,7 +4677,7 @@ + + printf("<a href='%s?host=%s", AVAIL_CGI, url_encode(hn)); + printf("&show_log_entries"); +- printf("&t1=%lu&t2=%lu", t1, t2); ++ printf("&t1=%lu&t2=%lu", (unsigned long)t1, (unsigned long)t2); + printf("&backtrack=%d", backtrack_archives); + printf("&assumestateretention=%s", (assume_state_retention == TRUE) ? "yes" : "no"); + printf("&assumeinitialstates=%s", (assume_initial_states == TRUE) ? "yes" : "no"); +@@ -4701,7 +4701,7 @@ + + printf("<a href='%s?host=%s", AVAIL_CGI, url_encode(hn)); + printf("&service=%s", url_encode(sd)); +- printf("&t1=%lu&t2=%lu", t1, t2); ++ printf("&t1=%lu&t2=%lu", (unsigned long)t1, (unsigned long)t2); + printf("&backtrack=%d", backtrack_archives); + printf("&assumestateretention=%s", (assume_state_retention == TRUE) ? "yes" : "no"); + printf("&assumeinitialstates=%s", (assume_initial_states == TRUE) ? "yes" : "no"); diff --git a/net/nagios-base/patches/patch-cgi_cmd.c b/net/nagios-base/patches/patch-cgi_cmd.c index 1905778f0ea..fd937ec4733 100644 --- a/net/nagios-base/patches/patch-cgi_cmd.c +++ b/net/nagios-base/patches/patch-cgi_cmd.c @@ -1,10 +1,11 @@ -$NetBSD: patch-cgi_cmd.c,v 1.4 2015/04/12 23:33:06 rodent Exp $ +$NetBSD: patch-cgi_cmd.c,v 1.5 2016/02/07 21:52:06 bouyer Exp $ Fix build in SunOS. +64bit time_t workaround. ---- cgi/cmd.c.orig 2014-08-12 15:00:01.000000000 +0000 -+++ cgi/cmd.c -@@ -1403,7 +1403,7 @@ void commit_command_data(int cmd) { +--- cgi/cmd.c.orig 2014-08-12 17:00:01.000000000 +0200 ++++ cgi/cmd.c 2016-02-07 22:41:29.000000000 +0100 +@@ -1403,7 +1403,7 @@ service *temp_service; host *temp_host; hostgroup *temp_hostgroup; @@ -13,3 +14,113 @@ Fix build in SunOS. scheduled_downtime *temp_downtime; servicegroup *temp_servicegroup = NULL; contact *temp_contact = NULL; +@@ -1906,7 +1906,7 @@ + if(!command_name || (strlen(command_name) > 6 && !memcmp("CHANGE", command_name, 6))) + return ERROR; + +- len = snprintf(cmd, sizeof(cmd), "[%lu] %s;", time(NULL), command_name); ++ len = snprintf(cmd, sizeof(cmd), "[%lu] %s;", (unsigned long)time(NULL), command_name); + if(len < 0 || len >= sizeof(cmd)) + return ERROR; + +@@ -2032,25 +2032,25 @@ + break; + + case CMD_DELAY_HOST_NOTIFICATION: +- result = cmd_submitf(cmd, "%s;%lu", host_name, notification_time); ++ result = cmd_submitf(cmd, "%s;%lu", host_name, (unsigned long)notification_time); + break; + + case CMD_DELAY_SVC_NOTIFICATION: +- result = cmd_submitf(cmd, "%s;%s;%lu", host_name, service_desc, notification_time); ++ result = cmd_submitf(cmd, "%s;%s;%lu", host_name, service_desc, (unsigned long)notification_time); + break; + + case CMD_SCHEDULE_SVC_CHECK: + case CMD_SCHEDULE_FORCED_SVC_CHECK: + if(force_check == TRUE) + cmd = CMD_SCHEDULE_FORCED_SVC_CHECK; +- result = cmd_submitf(cmd, "%s;%s;%lu", host_name, service_desc, start_time); ++ result = cmd_submitf(cmd, "%s;%s;%lu", host_name, service_desc, (unsigned long)start_time); + break; + + case CMD_DISABLE_NOTIFICATIONS: + case CMD_ENABLE_NOTIFICATIONS: + case CMD_SHUTDOWN_PROCESS: + case CMD_RESTART_PROCESS: +- result = cmd_submitf(cmd, "%lu", scheduled_time); ++ result = cmd_submitf(cmd, "%lu", (unsigned long)scheduled_time); + break; + + case CMD_ENABLE_HOST_SVC_CHECKS: +@@ -2065,7 +2065,7 @@ + case CMD_SCHEDULE_HOST_SVC_CHECKS: + if(force_check == TRUE) + cmd = CMD_SCHEDULE_FORCED_HOST_SVC_CHECKS; +- result = cmd_submitf(cmd, "%s;%lu", host_name, scheduled_time); ++ result = cmd_submitf(cmd, "%s;%lu", host_name, (unsigned long)scheduled_time); + break; + + case CMD_ENABLE_HOST_NOTIFICATIONS: +@@ -2106,15 +2106,15 @@ + else if(child_options == 2) + cmd = CMD_SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME; + +- result = cmd_submitf(cmd, "%s;%lu;%lu;%d;%lu;%lu;%s;%s", host_name, start_time, end_time, fixed, triggered_by, duration, comment_author, comment_data); ++ result = cmd_submitf(cmd, "%s;%lu;%lu;%d;%lu;%lu;%s;%s", host_name, (unsigned long)start_time, (unsigned long)end_time, fixed, triggered_by, duration, comment_author, comment_data); + break; + + case CMD_SCHEDULE_HOST_SVC_DOWNTIME: +- result = cmd_submitf(cmd, "%s;%lu;%lu;%d;%lu;%lu;%s;%s", host_name, start_time, end_time, fixed, triggered_by, duration, comment_author, comment_data); ++ result = cmd_submitf(cmd, "%s;%lu;%lu;%d;%lu;%lu;%s;%s", host_name, (unsigned long)start_time, (unsigned long)end_time, fixed, triggered_by, duration, comment_author, comment_data); + break; + + case CMD_SCHEDULE_SVC_DOWNTIME: +- result = cmd_submitf(cmd, "%s;%s;%lu;%lu;%d;%lu;%lu;%s;%s", host_name, service_desc, start_time, end_time, fixed, triggered_by, duration, comment_author, comment_data); ++ result = cmd_submitf(cmd, "%s;%s;%lu;%lu;%d;%lu;%lu;%s;%s", host_name, service_desc, (unsigned long)start_time, (unsigned long)end_time, fixed, triggered_by, duration, comment_author, comment_data); + break; + + case CMD_DEL_HOST_DOWNTIME: +@@ -2125,7 +2125,7 @@ + case CMD_SCHEDULE_HOST_CHECK: + if(force_check == TRUE) + cmd = CMD_SCHEDULE_FORCED_HOST_CHECK; +- result = cmd_submitf(cmd, "%s;%lu", host_name, start_time); ++ result = cmd_submitf(cmd, "%s;%lu", host_name, (unsigned long)start_time); + break; + + case CMD_SEND_CUSTOM_HOST_NOTIFICATION: +@@ -2163,13 +2163,13 @@ + break; + + case CMD_SCHEDULE_HOSTGROUP_HOST_DOWNTIME: +- result = cmd_submitf(cmd, "%s;%lu;%lu;%d;0;%lu;%s;%s", hostgroup_name, start_time, end_time, fixed, duration, comment_author, comment_data); ++ result = cmd_submitf(cmd, "%s;%lu;%lu;%d;0;%lu;%s;%s", hostgroup_name, (unsigned long)start_time, (unsigned long)end_time, fixed, duration, comment_author, comment_data); + break; + + case CMD_SCHEDULE_HOSTGROUP_SVC_DOWNTIME: +- result = cmd_submitf(cmd, "%s;%lu;%lu;%d;0;%lu;%s;%s", hostgroup_name, start_time, end_time, fixed, duration, comment_author, comment_data); ++ result = cmd_submitf(cmd, "%s;%lu;%lu;%d;0;%lu;%s;%s", hostgroup_name, (unsigned long)start_time, (unsigned long)end_time, fixed, duration, comment_author, comment_data); + if(affect_host_and_services == TRUE) +- result |= cmd_submitf(CMD_SCHEDULE_HOSTGROUP_HOST_DOWNTIME, "%s;%lu;%lu;%d;0;%lu;%s;%s", hostgroup_name, start_time, end_time, fixed, duration, comment_author, comment_data); ++ result |= cmd_submitf(CMD_SCHEDULE_HOSTGROUP_HOST_DOWNTIME, "%s;%lu;%lu;%d;0;%lu;%s;%s", hostgroup_name, (unsigned long)start_time, (unsigned long)end_time, fixed, duration, comment_author, comment_data); + break; + + +@@ -2199,13 +2199,13 @@ + break; + + case CMD_SCHEDULE_SERVICEGROUP_HOST_DOWNTIME: +- result = cmd_submitf(cmd, "%s;%lu;%lu;%d;0;%lu;%s;%s", servicegroup_name, start_time, end_time, fixed, duration, comment_author, comment_data); ++ result = cmd_submitf(cmd, "%s;%lu;%lu;%d;0;%lu;%s;%s", servicegroup_name, (unsigned long)start_time, (unsigned long)end_time, fixed, duration, comment_author, comment_data); + break; + + case CMD_SCHEDULE_SERVICEGROUP_SVC_DOWNTIME: +- result = cmd_submitf(cmd, "%s;%lu;%lu;%d;0;%lu;%s;%s", servicegroup_name, start_time, end_time, fixed, duration, comment_author, comment_data); ++ result = cmd_submitf(cmd, "%s;%lu;%lu;%d;0;%lu;%s;%s", servicegroup_name, (unsigned long)start_time, (unsigned long)end_time, fixed, duration, comment_author, comment_data); + if(affect_host_and_services == TRUE) +- result |= cmd_submitf(CMD_SCHEDULE_SERVICEGROUP_HOST_DOWNTIME, "%s;%lu;%lu;%d;0;%lu;%s;%s", servicegroup_name, start_time, end_time, fixed, duration, comment_author, comment_data); ++ result |= cmd_submitf(CMD_SCHEDULE_SERVICEGROUP_HOST_DOWNTIME, "%s;%lu;%lu;%d;0;%lu;%s;%s", servicegroup_name, (unsigned long)start_time, (unsigned long)end_time, fixed, duration, comment_author, comment_data); + break; + + default: diff --git a/net/nagios-base/patches/patch-cgi_histogram.c b/net/nagios-base/patches/patch-cgi_histogram.c new file mode 100644 index 00000000000..4f9c2e85b1e --- /dev/null +++ b/net/nagios-base/patches/patch-cgi_histogram.c @@ -0,0 +1,30 @@ +$NetBSD: patch-cgi_histogram.c,v 1.3 2016/02/07 21:52:06 bouyer Exp $ + +64bit time_t workaround + +--- cgi/histogram.c.orig 2016-02-07 22:21:30.000000000 +0100 ++++ cgi/histogram.c 2016-02-07 22:22:24.000000000 +0100 +@@ -338,9 +338,9 @@ + + if(display_type == DISPLAY_HOST_HISTOGRAM) { + #ifdef USE_TRENDS +- printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Trends For This Host</a><BR>\n", TRENDS_CGI, url_encode(host_name), t1, t2, (assume_state_retention == TRUE) ? "yes" : "no"); ++ printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Trends For This Host</a><BR>\n", TRENDS_CGI, url_encode(host_name), (unsigned long)t1, (unsigned long)t2, (assume_state_retention == TRUE) ? "yes" : "no"); + #endif +- printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s&show_log_entries'>View Availability Report For This Host</a><BR>\n", AVAIL_CGI, url_encode(host_name), t1, t2, (assume_state_retention == TRUE) ? "yes" : "no"); ++ printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s&show_log_entries'>View Availability Report For This Host</a><BR>\n", AVAIL_CGI, url_encode(host_name), (unsigned long)t1, (unsigned long)t2, (assume_state_retention == TRUE) ? "yes" : "no"); + printf("<a href='%s?host=%s'>View Status Detail For This Host</a><BR>\n", STATUS_CGI, url_encode(host_name)); + printf("<a href='%s?host=%s'>View History For This Host</a><BR>\n", HISTORY_CGI, url_encode(host_name)); + printf("<a href='%s?host=%s'>View Notifications For This Host</a><BR>\n", NOTIFICATIONS_CGI, url_encode(host_name)); +@@ -349,9 +349,9 @@ + #ifdef USE_TRENDS + printf("<a href='%s?host=%s", TRENDS_CGI, url_encode(host_name)); + #endif +- printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Trends For This Service</a><BR>\n", url_encode(svc_description), t1, t2, (assume_state_retention == TRUE) ? "yes" : "no"); ++ printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Trends For This Service</a><BR>\n", url_encode(svc_description), (unsigned long)t1, (unsigned long)t2, (assume_state_retention == TRUE) ? "yes" : "no"); + printf("<a href='%s?host=%s", AVAIL_CGI, url_encode(host_name)); +- printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s&show_log_entries'>View Availability Report For This Service</a><BR>\n", url_encode(svc_description), t1, t2, (assume_state_retention == TRUE) ? "yes" : "no"); ++ printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s&show_log_entries'>View Availability Report For This Service</a><BR>\n", url_encode(svc_description), (unsigned long)t1, (unsigned long)t2, (assume_state_retention == TRUE) ? "yes" : "no"); + printf("<A HREF='%s?host=%s&", HISTORY_CGI, url_encode(host_name)); + printf("service=%s'>View History For This Service</A><BR>\n", url_encode(svc_description)); + printf("<A HREF='%s?host=%s&", NOTIFICATIONS_CGI, url_encode(host_name)); diff --git a/net/nagios-base/patches/patch-cgi_trends.c b/net/nagios-base/patches/patch-cgi_trends.c new file mode 100644 index 00000000000..a35a40b9bcd --- /dev/null +++ b/net/nagios-base/patches/patch-cgi_trends.c @@ -0,0 +1,32 @@ +$NetBSD: patch-cgi_trends.c,v 1.3 2016/02/07 21:52:06 bouyer Exp $ + +64bit time_t workaround + +--- cgi/trends.c.orig 2016-02-07 22:18:31.000000000 +0100 ++++ cgi/trends.c 2016-02-07 22:21:11.000000000 +0100 +@@ -448,20 +448,20 @@ + printf("<TR><TD CLASS='linkBox'>\n"); + + if(display_type == DISPLAY_HOST_TRENDS) { +- printf("<a href='%s?host=%s&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedhoststate=%d&backtrack=%d&show_log_entries'>View Availability Report For This Host</a><BR>\n", AVAIL_CGI, url_encode(host_name), t1, t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_host_state, backtrack_archives); ++ printf("<a href='%s?host=%s&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedhoststate=%d&backtrack=%d&show_log_entries'>View Availability Report For This Host</a><BR>\n", AVAIL_CGI, url_encode(host_name), (unsigned long)t1, (unsigned long)t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_host_state, backtrack_archives); + #ifdef USE_HISTROGRAM +- printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Alert Histogram For This Host</a><BR>\n", HISTOGRAM_CGI, url_encode(host_name), t1, t2, (assume_state_retention == TRUE) ? "yes" : "no"); ++ printf("<a href='%s?host=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Alert Histogram For This Host</a><BR>\n", HISTOGRAM_CGI, url_encode(host_name), (unsigned long)t1, (unsigned long)t2, (assume_state_retention == TRUE) ? "yes" : "no"); + #endif + printf("<a href='%s?host=%s'>View Status Detail For This Host</a><BR>\n", STATUS_CGI, url_encode(host_name)); + printf("<a href='%s?host=%s'>View Alert History For This Host</a><BR>\n", HISTORY_CGI, url_encode(host_name)); + printf("<a href='%s?host=%s'>View Notifications For This Host</a><BR>\n", NOTIFICATIONS_CGI, url_encode(host_name)); + } + else { +- printf("<a href='%s?host=%s&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d'>View Trends For This Host</a><BR>\n", TRENDS_CGI, url_encode(host_name), t1, t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); ++ printf("<a href='%s?host=%s&t1=%lu&t2=%lu&includesoftstates=%s&assumestateretention=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d'>View Trends For This Host</a><BR>\n", TRENDS_CGI, url_encode(host_name), (unsigned long)t1, (unsigned long)t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); + printf("<a href='%s?host=%s", AVAIL_CGI, url_encode(host_name)); +- printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s&includesoftstates=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d&show_log_entries'>View Availability Report For This Service</a><BR>\n", url_encode(svc_description), t1, t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); ++ printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s&includesoftstates=%s&assumeinitialstates=%s&assumestatesduringnotrunning=%s&initialassumedservicestate=%d&backtrack=%d&show_log_entries'>View Availability Report For This Service</a><BR>\n", url_encode(svc_description), (unsigned long)t1, (unsigned long)t2, (include_soft_states == TRUE) ? "yes" : "no", (assume_state_retention == TRUE) ? "yes" : "no", (assume_initial_states == TRUE) ? "yes" : "no", (assume_states_during_notrunning == TRUE) ? "yes" : "no", initial_assumed_service_state, backtrack_archives); + printf("<a href='%s?host=%s", HISTOGRAM_CGI, url_encode(host_name)); +- printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Alert Histogram For This Service</a><BR>\n", url_encode(svc_description), t1, t2, (assume_state_retention == TRUE) ? "yes" : "no"); ++ printf("&service=%s&t1=%lu&t2=%lu&assumestateretention=%s'>View Alert Histogram For This Service</a><BR>\n", url_encode(svc_description), (unsigned long)t1, (unsigned long)t2, (assume_state_retention == TRUE) ? "yes" : "no"); + printf("<A HREF='%s?host=%s&", HISTORY_CGI, url_encode(host_name)); + printf("service=%s'>View Alert History For This Service</A><BR>\n", url_encode(svc_description)); + printf("<A HREF='%s?host=%s&", NOTIFICATIONS_CGI, url_encode(host_name)); diff --git a/net/nagios-base/patches/patch-common_downtime.c b/net/nagios-base/patches/patch-common_downtime.c new file mode 100644 index 00000000000..9af8150dda4 --- /dev/null +++ b/net/nagios-base/patches/patch-common_downtime.c @@ -0,0 +1,15 @@ +$NetBSD: patch-common_downtime.c,v 1.1 2016/02/07 21:52:06 bouyer Exp $ + +64bit time_t workaround + +--- common/downtime.c.orig 2016-02-07 22:06:39.000000000 +0100 ++++ common/downtime.c 2016-02-07 22:07:03.000000000 +0100 +@@ -240,7 +240,7 @@ + /* don't add old or invalid downtimes */ + if(start_time >= end_time || end_time <= time(NULL)) { + log_debug_info(DEBUGL_DOWNTIME, 1, "Invalid start (%lu) or end (%lu) times\n", +- start_time, end_time); ++ (unsigned long)start_time, (unsigned long)end_time); + return ERROR; + } + diff --git a/net/nagios-base/patches/patch-lib_test-squeue.c b/net/nagios-base/patches/patch-lib_test-squeue.c new file mode 100644 index 00000000000..8b6ec622d44 --- /dev/null +++ b/net/nagios-base/patches/patch-lib_test-squeue.c @@ -0,0 +1,15 @@ +$NetBSD: patch-lib_test-squeue.c,v 1.1 2016/02/07 21:52:06 bouyer Exp $ + +64bit time_t workaround + +--- lib/test-squeue.c.orig 2016-02-07 21:16:30.000000000 +0100 ++++ lib/test-squeue.c 2016-02-07 21:17:02.000000000 +0100 +@@ -50,7 +50,7 @@ + + walks++; + t(sq_high <= evt->when.tv_sec, "sq_high: %lu; evt->when: %lu\n", +- sq_high, evt->when.tv_sec); ++ sq_high, (unsigned long)evt->when.tv_sec); + sq_high = (unsigned long)evt->when.tv_sec; + + return 0; diff --git a/net/nagios-base/patches/patch-lib_worker.c b/net/nagios-base/patches/patch-lib_worker.c new file mode 100644 index 00000000000..f20d7feebd0 --- /dev/null +++ b/net/nagios-base/patches/patch-lib_worker.c @@ -0,0 +1,15 @@ +$NetBSD: patch-lib_worker.c,v 1.1 2016/02/07 21:52:06 bouyer Exp $ + +64bit time_t workaround + +--- lib/worker.c.orig 2014-08-12 17:00:01.000000000 +0200 ++++ lib/worker.c 2016-02-07 22:08:53.000000000 +0100 +@@ -194,7 +194,7 @@ + + #define kvvec_add_tv(kvv, key, value) \ + do { \ +- const char *buf = mkstr("%ld.%06ld", value.tv_sec, value.tv_usec); \ ++ const char *buf = mkstr("%ld.%06ld", (unsigned long)value.tv_sec, (unsigned long)value.tv_usec); \ + kvvec_addkv_wlen(kvv, key, sizeof(key) - 1, buf, strlen(buf)); \ + } while (0) + diff --git a/net/nagios-base/patches/patch-xdata_xrddefault.c b/net/nagios-base/patches/patch-xdata_xrddefault.c index bddadb89a8b..1a9f50e9600 100644 --- a/net/nagios-base/patches/patch-xdata_xrddefault.c +++ b/net/nagios-base/patches/patch-xdata_xrddefault.c @@ -1,10 +1,11 @@ -$NetBSD: patch-xdata_xrddefault.c,v 1.1 2015/04/12 23:33:06 rodent Exp $ +$NetBSD: patch-xdata_xrddefault.c,v 1.2 2016/02/07 21:52:06 bouyer Exp $ Fix build in SunOS. +64bit time_t workaround. ---- xdata/xrddefault.c.orig 2014-08-12 15:00:01.000000000 +0000 -+++ xdata/xrddefault.c -@@ -87,7 +87,7 @@ int xrddefault_save_state_information(vo +--- xdata/xrddefault.c.orig 2014-08-12 17:00:01.000000000 +0200 ++++ xdata/xrddefault.c 2016-02-07 22:01:56.000000000 +0100 +@@ -87,7 +87,7 @@ host *temp_host = NULL; service *temp_service = NULL; contact *temp_contact = NULL; @@ -13,3 +14,118 @@ Fix build in SunOS. scheduled_downtime *temp_downtime = NULL; int x = 0; int fd = 0; +@@ -151,9 +151,9 @@ + + /* write file info */ + fprintf(fp, "info {\n"); +- fprintf(fp, "created=%lu\n", current_time); ++ fprintf(fp, "created=%lu\n", (unsigned long)current_time); + fprintf(fp, "version=%s\n", PROGRAM_VERSION); +- fprintf(fp, "last_update_check=%lu\n", last_update_check); ++ fprintf(fp, "last_update_check=%lu\n", (unsigned long)last_update_check); + fprintf(fp, "update_available=%d\n", update_available); + fprintf(fp, "update_uid=%lu\n", update_uid); + fprintf(fp, "last_version=%s\n", (last_program_version == NULL) ? "" : last_program_version); +@@ -209,22 +209,22 @@ + fprintf(fp, "plugin_output=%s\n", (temp_host->plugin_output == NULL) ? "" : temp_host->plugin_output); + fprintf(fp, "long_plugin_output=%s\n", (temp_host->long_plugin_output == NULL) ? "" : temp_host->long_plugin_output); + fprintf(fp, "performance_data=%s\n", (temp_host->perf_data == NULL) ? "" : temp_host->perf_data); +- fprintf(fp, "last_check=%lu\n", temp_host->last_check); +- fprintf(fp, "next_check=%lu\n", temp_host->next_check); ++ fprintf(fp, "last_check=%lu\n", (unsigned long)temp_host->last_check); ++ fprintf(fp, "next_check=%lu\n", (unsigned long)temp_host->next_check); + fprintf(fp, "check_options=%d\n", temp_host->check_options); + fprintf(fp, "current_attempt=%d\n", temp_host->current_attempt); + fprintf(fp, "max_attempts=%d\n", temp_host->max_attempts); + fprintf(fp, "normal_check_interval=%f\n", temp_host->check_interval); + fprintf(fp, "retry_check_interval=%f\n", temp_host->check_interval); + fprintf(fp, "state_type=%d\n", temp_host->state_type); +- fprintf(fp, "last_state_change=%lu\n", temp_host->last_state_change); +- fprintf(fp, "last_hard_state_change=%lu\n", temp_host->last_hard_state_change); +- fprintf(fp, "last_time_up=%lu\n", temp_host->last_time_up); +- fprintf(fp, "last_time_down=%lu\n", temp_host->last_time_down); +- fprintf(fp, "last_time_unreachable=%lu\n", temp_host->last_time_unreachable); ++ fprintf(fp, "last_state_change=%lu\n", (unsigned long)temp_host->last_state_change); ++ fprintf(fp, "last_hard_state_change=%lu\n", (unsigned long)temp_host->last_hard_state_change); ++ fprintf(fp, "last_time_up=%lu\n", (unsigned long)temp_host->last_time_up); ++ fprintf(fp, "last_time_down=%lu\n", (unsigned long)temp_host->last_time_down); ++ fprintf(fp, "last_time_unreachable=%lu\n", (unsigned long)temp_host->last_time_unreachable); + fprintf(fp, "notified_on_down=%d\n", flag_isset(temp_host->notified_on, OPT_DOWN)); + fprintf(fp, "notified_on_unreachable=%d\n", flag_isset(temp_host->notified_on, OPT_UNREACHABLE)); +- fprintf(fp, "last_notification=%lu\n", temp_host->last_notification); ++ fprintf(fp, "last_notification=%lu\n", (unsigned long)temp_host->last_notification); + fprintf(fp, "current_notification_number=%d\n", temp_host->current_notification_number); + fprintf(fp, "current_notification_id=%lu\n", temp_host->current_notification_id); + fprintf(fp, "notifications_enabled=%d\n", temp_host->notifications_enabled); +@@ -281,24 +281,24 @@ + fprintf(fp, "normal_check_interval=%f\n", temp_service->check_interval); + fprintf(fp, "retry_check_interval=%f\n", temp_service->retry_interval); + fprintf(fp, "state_type=%d\n", temp_service->state_type); +- fprintf(fp, "last_state_change=%lu\n", temp_service->last_state_change); +- fprintf(fp, "last_hard_state_change=%lu\n", temp_service->last_hard_state_change); +- fprintf(fp, "last_time_ok=%lu\n", temp_service->last_time_ok); +- fprintf(fp, "last_time_warning=%lu\n", temp_service->last_time_warning); +- fprintf(fp, "last_time_unknown=%lu\n", temp_service->last_time_unknown); +- fprintf(fp, "last_time_critical=%lu\n", temp_service->last_time_critical); ++ fprintf(fp, "last_state_change=%lu\n", (unsigned long)temp_service->last_state_change); ++ fprintf(fp, "last_hard_state_change=%lu\n", (unsigned long)temp_service->last_hard_state_change); ++ fprintf(fp, "last_time_ok=%lu\n", (unsigned long)temp_service->last_time_ok); ++ fprintf(fp, "last_time_warning=%lu\n", (unsigned long)temp_service->last_time_warning); ++ fprintf(fp, "last_time_unknown=%lu\n", (unsigned long)temp_service->last_time_unknown); ++ fprintf(fp, "last_time_critical=%lu\n", (unsigned long)temp_service->last_time_critical); + fprintf(fp, "plugin_output=%s\n", (temp_service->plugin_output == NULL) ? "" : temp_service->plugin_output); + fprintf(fp, "long_plugin_output=%s\n", (temp_service->long_plugin_output == NULL) ? "" : temp_service->long_plugin_output); + fprintf(fp, "performance_data=%s\n", (temp_service->perf_data == NULL) ? "" : temp_service->perf_data); +- fprintf(fp, "last_check=%lu\n", temp_service->last_check); +- fprintf(fp, "next_check=%lu\n", temp_service->next_check); ++ fprintf(fp, "last_check=%lu\n", (unsigned long)temp_service->last_check); ++ fprintf(fp, "next_check=%lu\n", (unsigned long)temp_service->next_check); + fprintf(fp, "check_options=%d\n", temp_service->check_options); + fprintf(fp, "notified_on_unknown=%d\n", flag_isset(temp_service->notified_on, OPT_UNKNOWN)); + fprintf(fp, "notified_on_warning=%d\n", flag_isset(temp_service->notified_on, OPT_WARNING)); + fprintf(fp, "notified_on_critical=%d\n", flag_isset(temp_service->notified_on, OPT_CRITICAL)); + fprintf(fp, "current_notification_number=%d\n", temp_service->current_notification_number); + fprintf(fp, "current_notification_id=%lu\n", temp_service->current_notification_id); +- fprintf(fp, "last_notification=%lu\n", temp_service->last_notification); ++ fprintf(fp, "last_notification=%lu\n", (unsigned long)temp_service->last_notification); + fprintf(fp, "notifications_enabled=%d\n", temp_service->notifications_enabled); + fprintf(fp, "active_checks_enabled=%d\n", temp_service->checks_enabled); + fprintf(fp, "passive_checks_enabled=%d\n", temp_service->accept_passive_checks); +@@ -336,8 +336,8 @@ + fprintf(fp, "modified_service_attributes=%lu\n", (temp_contact->modified_service_attributes & ~contact_service_attribute_mask)); + fprintf(fp, "host_notification_period=%s\n", (temp_contact->host_notification_period == NULL) ? "" : temp_contact->host_notification_period); + fprintf(fp, "service_notification_period=%s\n", (temp_contact->service_notification_period == NULL) ? "" : temp_contact->service_notification_period); +- fprintf(fp, "last_host_notification=%lu\n", temp_contact->last_host_notification); +- fprintf(fp, "last_service_notification=%lu\n", temp_contact->last_service_notification); ++ fprintf(fp, "last_host_notification=%lu\n", (unsigned long)temp_contact->last_host_notification); ++ fprintf(fp, "last_service_notification=%lu\n", (unsigned long)temp_contact->last_service_notification); + fprintf(fp, "host_notifications_enabled=%d\n", temp_contact->host_notifications_enabled); + fprintf(fp, "service_notifications_enabled=%d\n", temp_contact->service_notifications_enabled); + +@@ -364,9 +364,9 @@ + fprintf(fp, "comment_id=%lu\n", temp_comment->comment_id); + fprintf(fp, "source=%d\n", temp_comment->source); + fprintf(fp, "persistent=%d\n", temp_comment->persistent); +- fprintf(fp, "entry_time=%lu\n", temp_comment->entry_time); ++ fprintf(fp, "entry_time=%lu\n", (unsigned long)temp_comment->entry_time); + fprintf(fp, "expires=%d\n", temp_comment->expires); +- fprintf(fp, "expire_time=%lu\n", temp_comment->expire_time); ++ fprintf(fp, "expire_time=%lu\n", (unsigned long)temp_comment->expire_time); + fprintf(fp, "author=%s\n", temp_comment->author); + fprintf(fp, "comment_data=%s\n", temp_comment->comment_data); + fprintf(fp, "}\n"); +@@ -384,10 +384,10 @@ + fprintf(fp, "service_description=%s\n", temp_downtime->service_description); + fprintf(fp, "comment_id=%lu\n", temp_downtime->comment_id); + fprintf(fp, "downtime_id=%lu\n", temp_downtime->downtime_id); +- fprintf(fp, "entry_time=%lu\n", temp_downtime->entry_time); +- fprintf(fp, "start_time=%lu\n", temp_downtime->start_time); +- fprintf(fp, "flex_downtime_start=%lu\n", temp_downtime->flex_downtime_start); +- fprintf(fp, "end_time=%lu\n", temp_downtime->end_time); ++ fprintf(fp, "entry_time=%lu\n", (unsigned long)temp_downtime->entry_time); ++ fprintf(fp, "start_time=%lu\n", (unsigned long)temp_downtime->start_time); ++ fprintf(fp, "flex_downtime_start=%lu\n", (unsigned long)temp_downtime->flex_downtime_start); ++ fprintf(fp, "end_time=%lu\n", (unsigned long)temp_downtime->end_time); + fprintf(fp, "triggered_by=%lu\n", temp_downtime->triggered_by); + fprintf(fp, "fixed=%d\n", temp_downtime->fixed); + fprintf(fp, "duration=%lu\n", temp_downtime->duration); diff --git a/net/nagios-base/patches/patch-xdata_xsddefault.c b/net/nagios-base/patches/patch-xdata_xsddefault.c index df755daaf89..2d6cd07374f 100644 --- a/net/nagios-base/patches/patch-xdata_xsddefault.c +++ b/net/nagios-base/patches/patch-xdata_xsddefault.c @@ -1,10 +1,11 @@ -$NetBSD: patch-xdata_xsddefault.c,v 1.1 2015/04/12 23:33:06 rodent Exp $ +$NetBSD: patch-xdata_xsddefault.c,v 1.2 2016/02/07 21:52:06 bouyer Exp $ Fix build in SunOS. +64bit time_t workaround. ---- xdata/xsddefault.c.orig 2014-08-12 15:00:01.000000000 +0000 -+++ xdata/xsddefault.c -@@ -118,7 +118,7 @@ int xsddefault_save_status_data(void) { +--- xdata/xsddefault.c.orig 2014-08-12 17:00:01.000000000 +0200 ++++ xdata/xsddefault.c 2016-02-07 22:37:22.000000000 +0100 +@@ -118,7 +118,7 @@ host *temp_host = NULL; service *temp_service = NULL; contact *temp_contact = NULL; @@ -13,3 +14,144 @@ Fix build in SunOS. scheduled_downtime *temp_downtime = NULL; time_t current_time; int fd = 0; +@@ -177,9 +177,9 @@ + + /* write file info */ + fprintf(fp, "info {\n"); +- fprintf(fp, "\tcreated=%lu\n", current_time); ++ fprintf(fp, "\tcreated=%lu\n", (unsigned long)current_time); + fprintf(fp, "\tversion=%s\n", PROGRAM_VERSION); +- fprintf(fp, "\tlast_update_check=%lu\n", last_update_check); ++ fprintf(fp, "\tlast_update_check=%lu\n", (unsigned long)last_update_check); + fprintf(fp, "\tupdate_available=%d\n", update_available); + fprintf(fp, "\tlast_version=%s\n", (last_program_version == NULL) ? "" : last_program_version); + fprintf(fp, "\tnew_version=%s\n", (new_program_version == NULL) ? "" : new_program_version); +@@ -191,8 +191,8 @@ + fprintf(fp, "\tmodified_service_attributes=%lu\n", modified_service_process_attributes); + fprintf(fp, "\tnagios_pid=%d\n", nagios_pid); + fprintf(fp, "\tdaemon_mode=%d\n", daemon_mode); +- fprintf(fp, "\tprogram_start=%lu\n", program_start); +- fprintf(fp, "\tlast_log_rotation=%lu\n", last_log_rotation); ++ fprintf(fp, "\tprogram_start=%lu\n", (unsigned long)program_start); ++ fprintf(fp, "\tlast_log_rotation=%lu\n", (unsigned long)last_log_rotation); + fprintf(fp, "\tenable_notifications=%d\n", enable_notifications); + fprintf(fp, "\tactive_service_checks_enabled=%d\n", execute_service_checks); + fprintf(fp, "\tpassive_service_checks_enabled=%d\n", accept_passive_service_checks); +@@ -255,19 +255,19 @@ + fprintf(fp, "\tplugin_output=%s\n", (temp_host->plugin_output == NULL) ? "" : temp_host->plugin_output); + fprintf(fp, "\tlong_plugin_output=%s\n", (temp_host->long_plugin_output == NULL) ? "" : temp_host->long_plugin_output); + fprintf(fp, "\tperformance_data=%s\n", (temp_host->perf_data == NULL) ? "" : temp_host->perf_data); +- fprintf(fp, "\tlast_check=%lu\n", temp_host->last_check); +- fprintf(fp, "\tnext_check=%lu\n", temp_host->next_check); ++ fprintf(fp, "\tlast_check=%lu\n", (unsigned long)temp_host->last_check); ++ fprintf(fp, "\tnext_check=%lu\n", (unsigned long)temp_host->next_check); + fprintf(fp, "\tcheck_options=%d\n", temp_host->check_options); + fprintf(fp, "\tcurrent_attempt=%d\n", temp_host->current_attempt); + fprintf(fp, "\tmax_attempts=%d\n", temp_host->max_attempts); + fprintf(fp, "\tstate_type=%d\n", temp_host->state_type); +- fprintf(fp, "\tlast_state_change=%lu\n", temp_host->last_state_change); +- fprintf(fp, "\tlast_hard_state_change=%lu\n", temp_host->last_hard_state_change); +- fprintf(fp, "\tlast_time_up=%lu\n", temp_host->last_time_up); +- fprintf(fp, "\tlast_time_down=%lu\n", temp_host->last_time_down); +- fprintf(fp, "\tlast_time_unreachable=%lu\n", temp_host->last_time_unreachable); +- fprintf(fp, "\tlast_notification=%lu\n", temp_host->last_notification); +- fprintf(fp, "\tnext_notification=%lu\n", temp_host->next_notification); ++ fprintf(fp, "\tlast_state_change=%lu\n", (unsigned long)temp_host->last_state_change); ++ fprintf(fp, "\tlast_hard_state_change=%lu\n", (unsigned long)temp_host->last_hard_state_change); ++ fprintf(fp, "\tlast_time_up=%lu\n", (unsigned long)temp_host->last_time_up); ++ fprintf(fp, "\tlast_time_down=%lu\n", (unsigned long)temp_host->last_time_down); ++ fprintf(fp, "\tlast_time_unreachable=%lu\n", (unsigned long)temp_host->last_time_unreachable); ++ fprintf(fp, "\tlast_notification=%lu\n", (unsigned long)temp_host->last_notification); ++ fprintf(fp, "\tnext_notification=%lu\n", (unsigned long)temp_host->next_notification); + fprintf(fp, "\tno_more_notifications=%d\n", temp_host->no_more_notifications); + fprintf(fp, "\tcurrent_notification_number=%d\n", temp_host->current_notification_number); + fprintf(fp, "\tcurrent_notification_id=%lu\n", temp_host->current_notification_id); +@@ -280,7 +280,7 @@ + fprintf(fp, "\tflap_detection_enabled=%d\n", temp_host->flap_detection_enabled); + fprintf(fp, "\tprocess_performance_data=%d\n", temp_host->process_performance_data); + fprintf(fp, "\tobsess=%d\n", temp_host->obsess); +- fprintf(fp, "\tlast_update=%lu\n", current_time); ++ fprintf(fp, "\tlast_update=%lu\n", (unsigned long)current_time); + fprintf(fp, "\tis_flapping=%d\n", temp_host->is_flapping); + fprintf(fp, "\tpercent_state_change=%.2f\n", temp_host->percent_state_change); + fprintf(fp, "\tscheduled_downtime_depth=%d\n", temp_host->scheduled_downtime_depth); +@@ -321,22 +321,22 @@ + fprintf(fp, "\tcurrent_attempt=%d\n", temp_service->current_attempt); + fprintf(fp, "\tmax_attempts=%d\n", temp_service->max_attempts); + fprintf(fp, "\tstate_type=%d\n", temp_service->state_type); +- fprintf(fp, "\tlast_state_change=%lu\n", temp_service->last_state_change); +- fprintf(fp, "\tlast_hard_state_change=%lu\n", temp_service->last_hard_state_change); +- fprintf(fp, "\tlast_time_ok=%lu\n", temp_service->last_time_ok); +- fprintf(fp, "\tlast_time_warning=%lu\n", temp_service->last_time_warning); +- fprintf(fp, "\tlast_time_unknown=%lu\n", temp_service->last_time_unknown); +- fprintf(fp, "\tlast_time_critical=%lu\n", temp_service->last_time_critical); ++ fprintf(fp, "\tlast_state_change=%lu\n", (unsigned long)temp_service->last_state_change); ++ fprintf(fp, "\tlast_hard_state_change=%lu\n", (unsigned long)temp_service->last_hard_state_change); ++ fprintf(fp, "\tlast_time_ok=%lu\n", (unsigned long)temp_service->last_time_ok); ++ fprintf(fp, "\tlast_time_warning=%lu\n", (unsigned long)temp_service->last_time_warning); ++ fprintf(fp, "\tlast_time_unknown=%lu\n", (unsigned long)temp_service->last_time_unknown); ++ fprintf(fp, "\tlast_time_critical=%lu\n", (unsigned long)temp_service->last_time_critical); + fprintf(fp, "\tplugin_output=%s\n", (temp_service->plugin_output == NULL) ? "" : temp_service->plugin_output); + fprintf(fp, "\tlong_plugin_output=%s\n", (temp_service->long_plugin_output == NULL) ? "" : temp_service->long_plugin_output); + fprintf(fp, "\tperformance_data=%s\n", (temp_service->perf_data == NULL) ? "" : temp_service->perf_data); +- fprintf(fp, "\tlast_check=%lu\n", temp_service->last_check); +- fprintf(fp, "\tnext_check=%lu\n", temp_service->next_check); ++ fprintf(fp, "\tlast_check=%lu\n", (unsigned long)temp_service->last_check); ++ fprintf(fp, "\tnext_check=%lu\n", (unsigned long)temp_service->next_check); + fprintf(fp, "\tcheck_options=%d\n", temp_service->check_options); + fprintf(fp, "\tcurrent_notification_number=%d\n", temp_service->current_notification_number); + fprintf(fp, "\tcurrent_notification_id=%lu\n", temp_service->current_notification_id); +- fprintf(fp, "\tlast_notification=%lu\n", temp_service->last_notification); +- fprintf(fp, "\tnext_notification=%lu\n", temp_service->next_notification); ++ fprintf(fp, "\tlast_notification=%lu\n", (unsigned long)temp_service->last_notification); ++ fprintf(fp, "\tnext_notification=%lu\n", (unsigned long)temp_service->next_notification); + fprintf(fp, "\tno_more_notifications=%d\n", temp_service->no_more_notifications); + fprintf(fp, "\tnotifications_enabled=%d\n", temp_service->notifications_enabled); + fprintf(fp, "\tactive_checks_enabled=%d\n", temp_service->checks_enabled); +@@ -347,7 +347,7 @@ + fprintf(fp, "\tflap_detection_enabled=%d\n", temp_service->flap_detection_enabled); + fprintf(fp, "\tprocess_performance_data=%d\n", temp_service->process_performance_data); + fprintf(fp, "\tobsess=%d\n", temp_service->obsess); +- fprintf(fp, "\tlast_update=%lu\n", current_time); ++ fprintf(fp, "\tlast_update=%lu\n", (unsigned long)current_time); + fprintf(fp, "\tis_flapping=%d\n", temp_service->is_flapping); + fprintf(fp, "\tpercent_state_change=%.2f\n", temp_service->percent_state_change); + fprintf(fp, "\tscheduled_downtime_depth=%d\n", temp_service->scheduled_downtime_depth); +@@ -371,8 +371,8 @@ + fprintf(fp, "\thost_notification_period=%s\n", (temp_contact->host_notification_period == NULL) ? "" : temp_contact->host_notification_period); + fprintf(fp, "\tservice_notification_period=%s\n", (temp_contact->service_notification_period == NULL) ? "" : temp_contact->service_notification_period); + +- fprintf(fp, "\tlast_host_notification=%lu\n", temp_contact->last_host_notification); +- fprintf(fp, "\tlast_service_notification=%lu\n", temp_contact->last_service_notification); ++ fprintf(fp, "\tlast_host_notification=%lu\n", (unsigned long)temp_contact->last_host_notification); ++ fprintf(fp, "\tlast_service_notification=%lu\n", (unsigned long)temp_contact->last_service_notification); + fprintf(fp, "\thost_notifications_enabled=%d\n", temp_contact->host_notifications_enabled); + fprintf(fp, "\tservice_notifications_enabled=%d\n", temp_contact->service_notifications_enabled); + /* custom variables */ +@@ -397,9 +397,9 @@ + fprintf(fp, "\tcomment_id=%lu\n", temp_comment->comment_id); + fprintf(fp, "\tsource=%d\n", temp_comment->source); + fprintf(fp, "\tpersistent=%d\n", temp_comment->persistent); +- fprintf(fp, "\tentry_time=%lu\n", temp_comment->entry_time); ++ fprintf(fp, "\tentry_time=%lu\n", (unsigned long)temp_comment->entry_time); + fprintf(fp, "\texpires=%d\n", temp_comment->expires); +- fprintf(fp, "\texpire_time=%lu\n", temp_comment->expire_time); ++ fprintf(fp, "\texpire_time=%lu\n", (unsigned long)temp_comment->expire_time); + fprintf(fp, "\tauthor=%s\n", temp_comment->author); + fprintf(fp, "\tcomment_data=%s\n", temp_comment->comment_data); + fprintf(fp, "\t}\n\n"); +@@ -417,10 +417,10 @@ + fprintf(fp, "\tservice_description=%s\n", temp_downtime->service_description); + fprintf(fp, "\tdowntime_id=%lu\n", temp_downtime->downtime_id); + fprintf(fp, "\tcomment_id=%lu\n", temp_downtime->comment_id); +- fprintf(fp, "\tentry_time=%lu\n", temp_downtime->entry_time); +- fprintf(fp, "\tstart_time=%lu\n", temp_downtime->start_time); +- fprintf(fp, "\tflex_downtime_start=%lu\n", temp_downtime->flex_downtime_start); +- fprintf(fp, "\tend_time=%lu\n", temp_downtime->end_time); ++ fprintf(fp, "\tentry_time=%lu\n", (unsigned long)temp_downtime->entry_time); ++ fprintf(fp, "\tstart_time=%lu\n", (unsigned long)temp_downtime->start_time); ++ fprintf(fp, "\tflex_downtime_start=%lu\n", (unsigned long)temp_downtime->flex_downtime_start); ++ fprintf(fp, "\tend_time=%lu\n", (unsigned long)temp_downtime->end_time); + fprintf(fp, "\ttriggered_by=%lu\n", temp_downtime->triggered_by); + fprintf(fp, "\tfixed=%d\n", temp_downtime->fixed); + fprintf(fp, "\tduration=%lu\n", temp_downtime->duration); |