From: Christoph Egger Subject: [PATCH] tools: portability fixes Date: Thu, 2 Jul 2009 12:03:03 +0200 Message-ID: <200907021203.04076.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_YXITKA2bC75+t4r" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: guanqun.lu@intel.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_YXITKA2bC75+t4r Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! Attached patch makes gtraceview compile on NetBSD. Signed-off-by: Christoph Egger @Guanqun.Lu: 1. Why do you hardcode -lncurses, when there is a CURSES_LIBS variable ? The existence of it should have ring an alarm bell that your code isn't portable, i.e. that you can't blindly include . 2. The string operations look dangerous in respect to security. Please fix them. Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --Boundary-00=_YXITKA2bC75+t4r Content-Type: text/x-diff; charset="us-ascii"; name="xen_gtrace.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_gtrace.diff" diff -r 80839a223746 tools/misc/Makefile --- a/tools/misc/Makefile Wed Jul 01 20:22:29 2009 +0100 +++ b/tools/misc/Makefile Thu Jul 02 11:54:52 2009 +0200 @@ -57,6 +57,6 @@ xenperf xenpm gtracestat: %: %.o Makefil $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDFLAGS_libxenctrl) gtraceview: %: %.o Makefile - $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -lncurses + $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CURSES_LIBS) -include $(DEPS) diff -r 80839a223746 tools/misc/gtraceview.c --- a/tools/misc/gtraceview.c Wed Jul 01 20:22:29 2009 +0100 +++ b/tools/misc/gtraceview.c Thu Jul 02 11:54:52 2009 +0200 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,12 @@ #include #include +#ifdef __Linux__ #include +#endif +#ifdef __NetBSD__ +#include +#endif /********** MACROS **********/ #define MAX_CPU_NR 32 --Boundary-00=_YXITKA2bC75+t4r Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_YXITKA2bC75+t4r--