libxl: fix build failure (unused variables) for non-Linux platforms
authorChristoph Egger <Christoph.Egger@amd.com>
Thu, 26 May 2011 14:55:22 +0000 (15:55 +0100)
committerChristoph Egger <Christoph.Egger@amd.com>
Thu, 26 May 2011 14:55:22 +0000 (15:55 +0100)
Move variable definitions into Linux-specific sections where they are
actually used. Fixes warning about unused variables.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_exec.c

index 27fd6cd6004c22cab40abf37ca5df20d60309796..87715c65014ee726715e833a41d5d7bea251bcc5 100644 (file)
@@ -41,8 +41,6 @@ static void check_open_fds(const char *what)
     const char *env_debug;
     int debug;
     int i, flags, badness = 0;
-    char path[PATH_MAX];
-    char link[PATH_MAX+1];
 
     env_debug = getenv("_LIBXL_DEBUG_EXEC_FDS");
     if (!env_debug) return;
@@ -53,6 +51,8 @@ static void check_open_fds(const char *what)
     for (i = 4; i < 256; i++) {
 #ifdef __linux__
         size_t len;
+        char path[PATH_MAX];
+        char link[PATH_MAX+1];
 #endif
         flags = fcntl(i, F_GETFD);
         if ( flags == -1 ) {