[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 4 of 8] tools: libxl: constify parameter to libxl__abs_path



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1305294079 -3600
# Node ID 66579385ed4e553740ac8e44c514bb10336686e7
# Parent  84c3d1d16ddc3bc674354e5da8e97bac2ac9cc14
tools: libxl: constify parameter to libxl__abs_path

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 84c3d1d16ddc -r 66579385ed4e tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c      Fri May 13 14:41:19 2011 +0100
+++ b/tools/libxl/libxl_internal.c      Fri May 13 14:41:19 2011 +0100
@@ -184,10 +184,10 @@ void libxl__log(libxl_ctx *ctx, xentooll
     va_end(ap);
 }
 
-char *libxl__abs_path(libxl__gc *gc, char *s, const char *path)
+char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path)
 {
     if (!s || s[0] == '/')
-        return s;
+        return libxl__strdup(gc, s);
     return libxl__sprintf(gc, "%s/%s", path, s);
 }
 
diff -r 84c3d1d16ddc -r 66579385ed4e tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Fri May 13 14:41:19 2011 +0100
+++ b/tools/libxl/libxl_internal.h      Fri May 13 14:41:19 2011 +0100
@@ -309,7 +309,7 @@ _hidden void libxl__exec(int stdinfd, in
 _hidden void libxl__log_child_exitstatus(libxl__gc *gc,
                                 const char *what, pid_t pid, int status);
 
-_hidden char *libxl__abs_path(libxl__gc *gc, char *s, const char *path);
+_hidden char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path);
 
 #define LIBXL__LOG_DEBUG   XTL_DEBUG
 #define LIBXL__LOG_INFO    XTL_INFO

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.