$OpenBSD: patch-src_rrd_tool_c,v 1.1 2004/06/08 20:21:24 danh Exp $
--- src/rrd_tool.c.orig	2004-04-06 17:38:15.000000000 -0400
+++ src/rrd_tool.c	2004-06-08 13:41:55.000000000 -0400
@@ -81,7 +81,7 @@ void PrintUsage(char *cmd)
 	   "\t\t[--units-length value]\n"	   
 	   "\t\t[--step seconds]\n"	   
 	   "\t\t[-f|--imginfo printfstr]\n"
-	   "\t\t[-a|--imgformat GIF|PNG]\n"
+	   "\t\t[-a|--imgformat PNG]\n"
 	   "\t\t[-c|--color COLORTAG#rrggbb] [-t|--title string]\n"
 	   "\t\t[DEF:vname=rrd:ds-name:CF]\n"
 	   "\t\t[CDEF:vname=rpn-expression]\n"
@@ -328,7 +328,7 @@ int HandleInputLine(int argc, char **arg
     else if (strcmp("resize", argv[1]) == 0)
 	rrd_resize(argc-1, &argv[1]);
     else if (strcmp("last", argv[1]) == 0)
-        printf("%ld\n",rrd_last(argc-1, &argv[1]));
+        printf("%.0f\n",difftime(rrd_last(argc-1, &argv[1]), 0));
     else if (strcmp("update", argv[1]) == 0)
 	rrd_update(argc-1, &argv[1]);
     else if (strcmp("fetch", argv[1]) == 0) {
@@ -366,9 +366,9 @@ int HandleInputLine(int argc, char **arg
 	  printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n\n", XML_ENCODING);
 	  printf("<%s>\n", ROOT_TAG);
 	  printf("  <%s>\n", META_TAG);
-	  printf("    <%s>%lu</%s>\n", META_START_TAG, start, META_START_TAG);
+	  printf("    <%s>%.0f</%s>\n", META_START_TAG, difftime(start, 0), META_START_TAG);
 	  printf("    <%s>%lu</%s>\n", META_STEP_TAG, step, META_STEP_TAG);
-	  printf("    <%s>%lu</%s>\n", META_END_TAG, end, META_END_TAG);
+	  printf("    <%s>%.0f</%s>\n", META_END_TAG, difftime(end, 0), META_END_TAG);
 	  printf("    <%s>%lu</%s>\n", META_ROWS_TAG, row_cnt, META_ROWS_TAG);
 	  printf("    <%s>%lu</%s>\n", META_COLS_TAG, col_cnt, META_COLS_TAG);
 	  printf("    <%s>\n", LEGEND_TAG);
@@ -384,7 +384,7 @@ int HandleInputLine(int argc, char **arg
 	  printf("  <%s>\n", DATA_TAG);
 	  for (i = start; i <= end; i += step) {
 	    printf ("    <%s>", DATA_ROW_TAG);
-	    printf ("<%s>%lu</%s>", COL_TIME_TAG, i, COL_TIME_TAG);
+	    printf ("<%s>%.0f</%s>", COL_TIME_TAG, difftime(i, 0), COL_TIME_TAG);
 	    for (j = 0; j < col_cnt; j++) {
 	      rrd_value_t newval = DNAN;
 	      newval = *(ptr++);
