WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxl: Intruduce libxl__strndup.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: Intruduce libxl__strndup.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 01 Oct 2011 03:33:14 +0100
Delivery-date: Fri, 30 Sep 2011 19:34:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Anthony PERARD <anthony.perard@xxxxxxxxxx>
# Date 1317310103 -3600
# Node ID 066dc3758fa46525c5db9f314bc617542f1ea671
# Parent  952e0118a7c47c467c34f24f9c271902eed3bc99
libxl: Intruduce libxl__strndup.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 952e0118a7c4 -r 066dc3758fa4 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c      Thu Sep 29 16:28:22 2011 +0100
+++ b/tools/libxl/libxl_internal.c      Thu Sep 29 16:28:23 2011 +0100
@@ -159,6 +159,16 @@
     return s;
 }
 
+char *libxl__strndup(libxl__gc *gc, const char *c, size_t n)
+{
+    char *s = strndup(c, n);
+
+    if (s)
+        libxl__ptr_add(gc, s);
+
+    return s;
+}
+
 char *libxl__dirname(libxl__gc *gc, const char *s)
 {
     char *c;
diff -r 952e0118a7c4 -r 066dc3758fa4 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Thu Sep 29 16:28:22 2011 +0100
+++ b/tools/libxl/libxl_internal.h      Thu Sep 29 16:28:23 2011 +0100
@@ -148,6 +148,7 @@
 _hidden void *libxl__realloc(libxl__gc *gc, void *ptr, size_t new_size);
 _hidden char *libxl__sprintf(libxl__gc *gc, const char *fmt, ...) 
PRINTF_ATTRIBUTE(2, 3);
 _hidden char *libxl__strdup(libxl__gc *gc, const char *c);
+_hidden char *libxl__strndup(libxl__gc *gc, const char *c, size_t n);
 _hidden char *libxl__dirname(libxl__gc *gc, const char *s);
 
 _hidden char **libxl__xs_kvs_of_flexarray(libxl__gc *gc, flexarray_t *array, 
int length);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: Intruduce libxl__strndup., Xen patchbot-unstable <=