summaryrefslogtreecommitdiff
path: root/sysutils/xentools3/patches/patch-cg
blob: 29f197b22c76324b45aeda2ec99223f46ed79551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
$NetBSD: patch-cg,v 1.3 2013/04/11 19:57:52 joerg Exp $

--- xenstat/xentop/xentop.c.orig	2008-04-25 13:03:12.000000000 +0000
+++ xenstat/xentop/xentop.c
@@ -18,7 +18,8 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <curses.h>
+#include <ncurses.h>
+#define vw_printw vwprintw
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>
@@ -28,7 +29,11 @@
 #include <sys/time.h>
 #include <time.h>
 #include <unistd.h>
+#ifndef __NetBSD__
 #include <linux/kdev_t.h>
+#else
+#include <stdarg.h>
+#endif
 
 #include <xenstat.h>
 
@@ -251,7 +256,7 @@ static void fail(const char *str)
 {
 	if(cwin != NULL && !isendwin())
 		endwin();
-	fprintf(stderr, str);
+	fprintf(stderr, "%s", str);
 	exit(1);
 }
 
@@ -752,10 +757,11 @@ void do_summary(void)
 	unsigned i, num_domains = 0;
 	unsigned long long used = 0;
 	xenstat_domain *domain;
+	time_t curt;
 
 	/* Print program name, current time, and number of domains */
-	strftime(time_str, TIME_STR_LEN, TIME_STR_FORMAT,
-	         localtime(&curtime.tv_sec));
+	curt = curtime.tv_sec;
+	strftime(time_str, TIME_STR_LEN, TIME_STR_FORMAT, localtime(&curt));
 	num_domains = xenstat_node_num_domains(cur_node);
 	ver_str = xenstat_node_xen_version(cur_node);
 	print("xentop - %s   Xen %s\n", time_str, ver_str);
@@ -921,6 +927,7 @@ void do_network(xenstat_domain *domain)
 /* Output all VBD information */
 void do_vbd(xenstat_domain *domain)
 {
+#ifdef notyet
 	int i = 0;
 	xenstat_vbd *vbd;
 	unsigned num_vbds = 0;
@@ -952,6 +959,7 @@ void do_vbd(xenstat_domain *domain)
 		      xenstat_vbd_rd_reqs(vbd),
 		      xenstat_vbd_wr_reqs(vbd));
 	}
+#endif
 }
 
 static void top(void)