42 lines
1.5 KiB
Plaintext
42 lines
1.5 KiB
Plaintext
$OpenBSD: patch-readv23_c,v 1.3 2011/03/04 11:21:45 sthen Exp $
|
|
--- readv23.c.orig Sat Oct 16 15:47:56 2010
|
|
+++ readv23.c Fri Mar 4 12:14:16 2011
|
|
@@ -37,8 +37,11 @@ struct status_dot_dat_entry {
|
|
char *rhs;
|
|
};
|
|
|
|
+void parse_entry(struct status_dot_dat_entry *, char *);
|
|
+
|
|
/*------------------------------------------------------------------*/
|
|
|
|
+void
|
|
read_v23_status()
|
|
{
|
|
FILE *fp;
|
|
@@ -157,7 +160,7 @@ debug(" plugin_output (post-munge) is %s",host_list[h
|
|
for (i=0; i < 11; i++) { fgets(buffer,sizeof(buffer),fp); }
|
|
}
|
|
parse_entry(&ent,buffer);
|
|
- sscanf(ent.rhs,"%ld",&stamp);
|
|
+ sscanf(ent.rhs,"%d",&stamp);
|
|
|
|
if ( (stamp == 0) && (host_list[host_list_size][PLUGIN_OUTPUT][0] == '\0') ) {
|
|
/* PENDING... is really UP with NULL plugin output on Jan 1 1970... */
|
|
@@ -277,7 +280,7 @@ debug(" OUT current_state is %s",service_list[service
|
|
for (i=0; i < 11; i++) { fgets(buffer,sizeof(buffer),fp); }
|
|
}
|
|
parse_entry(&ent,buffer);
|
|
- sscanf(ent.rhs,"%ld",&stamp);
|
|
+ sscanf(ent.rhs,"%d",&stamp);
|
|
service_list[service_list_size][LAST_STATE_CHANGE_INT] = (char *)stamp;
|
|
service_list[service_list_size][LAST_STATE_CHANGE] = malloc(17); /* "DOW Mon DD HH:MM\0" */
|
|
strncpy(service_list[service_list_size][LAST_STATE_CHANGE],ctime((time_t *)&stamp),16);
|
|
@@ -375,6 +378,7 @@ debug(" OUT plugin_output after munge is %s",service_
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
|
|
+void
|
|
parse_entry(ent,str)
|
|
struct status_dot_dat_entry *ent;
|
|
char *str;
|